docs
Docs
C++ API
C API
Search API
Ctrl K
1.4
2.0
latest
1.4
Ultralight C API
1.4.0
Toggle main menu visibility
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
21
#include <
Ultralight/CAPI/CAPI_Defines.h
>
22
23
#ifdef __cplusplus
24
extern
"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
///
34
ULExport
ULKeyEvent
ulCreateKeyEvent
(
ULKeyEventType
type,
unsigned
int
modifiers,
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
///
43
ULExport
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
///
51
ULExport
ULKeyEvent
ulCreateKeyEventMacOS(NSEvent* evt);
52
#endif
53
54
///
55
/// Destroy a key event.
56
///
57
ULExport
void
ulDestroyKeyEvent
(
ULKeyEvent
evt);
58
59
#ifdef __cplusplus
60
}
// extern "C"
61
#endif
62
63
#endif
// ULTRALIGHT_CAPI_KEYEVENT_H
CAPI_Defines.h
Various defines and utility functions for the C API.
ULString
struct C_String * ULString
Definition
CAPI_Defines.h:65
ULExport
#define ULExport
Definition
CAPI_Defines.h:38
ULKeyEventType
ULKeyEventType
Definition
CAPI_Defines.h:173
ULKeyEvent
struct C_KeyEvent * ULKeyEvent
Definition
CAPI_Defines.h:67
ulDestroyKeyEvent
void ulDestroyKeyEvent(ULKeyEvent evt)
Destroy a key event.
ulCreateKeyEvent
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.
Ultralight
CAPI
CAPI_KeyEvent.h
Docs
C++ API
C API
Version
1.4
2.0
latest
1.4