Loading...
Searching...
No Matches
CAPI_KeyEvent.h
Go to the documentation of this file.
1/**************************************************************************************************
2 * This file is a part of Ultralight. *
3 * *
4 * See <https://ultralig.ht> for licensing and more. *
5 * *
6 * (C) 2024 Ultralight, Inc. *
7 **************************************************************************************************/
8
9///
10/// @file CAPI_KeyEvent.h
11///
12/// Key event interface.
13///
14/// `#include <Ultralight/CAPI/CAPI_KeyEvent.h>`
15///
16/// This file defines the C API for various key events.
17///
18#ifndef ULTRALIGHT_CAPI_KEYEVENT_H
19#define ULTRALIGHT_CAPI_KEYEVENT_H
20
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/******************************************************************************
28 * Key Event
29 ******************************************************************************/
30
31///
32/// Create a key event, see KeyEvent in the C++ API for help with the parameters.
33///
35 int virtual_key_code, int native_key_code, ULString text,
36 ULString unmodified_text, bool is_keypad, bool is_auto_repeat,
37 bool is_system_key);
38
39#ifdef _WIN32
40///
41/// Create a key event from native Windows event.
42///
43ULExport ULKeyEvent ulCreateKeyEventWindows(ULKeyEventType type, uintptr_t wparam, intptr_t lparam,
44 bool is_system_key);
45#endif
46
47#ifdef __OBJC__
48///
49/// Create a key event from native macOS event.
50///
51ULExport ULKeyEvent ulCreateKeyEventMacOS(NSEvent* evt);
52#endif
53
54///
55/// Destroy a key event.
56///
58
59#ifdef __cplusplus
60} // extern "C"
61#endif
62
63#endif // ULTRALIGHT_CAPI_KEYEVENT_H
Various defines and utility functions for the C API.
struct C_String * ULString
Definition CAPI_Defines.h:65
#define ULExport
Definition CAPI_Defines.h:38
ULKeyEventType
Definition CAPI_Defines.h:173
struct C_KeyEvent * ULKeyEvent
Definition CAPI_Defines.h:67
ULExport ULKeyEvent ulCreateKeyEvent(ULKeyEventType type, unsigned int modifiers, int virtual_key_code, int native_key_code, ULString text, ULString unmodified_text, bool is_keypad, bool is_auto_repeat, bool is_system_key)
Create a key event, see KeyEvent in the C++ API for help with the parameters.
ULExport void ulDestroyKeyEvent(ULKeyEvent evt)
Destroy a key event.