Ultralight C API 1.3.0
Loading...
Searching...
No Matches
CAPI_KeyEvent.h
Go to the documentation of this file.
1/******************************************************************************
2 * This file is a part of Ultralight, an ultra-portable web-browser engine. *
3 * *
4 * See <https://ultralig.ht> for licensing and more. *
5 * *
6 * (C) 2023 Ultralight, Inc. *
7 *****************************************************************************/
8#ifndef ULTRALIGHT_CAPI_KEYEVENT_H
9#define ULTRALIGHT_CAPI_KEYEVENT_H
10
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/******************************************************************************
18 * Key Event
19 ******************************************************************************/
20
21///
22/// Create a key event, @see KeyEvent for help with the following parameters.
23///
25 int virtual_key_code, int native_key_code, ULString text,
26 ULString unmodified_text, bool is_keypad, bool is_auto_repeat,
27 bool is_system_key);
28
29#ifdef _WIN32
30///
31/// Create a key event from native Windows event.
32///
33ULExport ULKeyEvent ulCreateKeyEventWindows(ULKeyEventType type, uintptr_t wparam, intptr_t lparam,
34 bool is_system_key);
35#endif
36
37#ifdef __OBJC__
38///
39/// Create a key event from native macOS event.
40///
41ULExport ULKeyEvent ulCreateKeyEventMacOS(NSEvent* evt);
42#endif
43
44///
45/// Destroy a key event.
46///
48
49#ifdef __cplusplus
50} // extern "C"
51#endif
52
53#endif // ULTRALIGHT_CAPI_KEYEVENT_H
struct C_String * ULString
Definition CAPI_Defines.h:54
#define ULExport
Definition CAPI_Defines.h:27
ULKeyEventType
Definition CAPI_Defines.h:155
struct C_KeyEvent * ULKeyEvent
Definition CAPI_Defines.h:56
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,.
ULExport void ulDestroyKeyEvent(ULKeyEvent evt)
Destroy a key event.