#include <stdlib.h>
#include <string.h>
#include "events/keyboard_event.h"
#include "core/document.h"
#include "utils/utils.h"
|
dom_exception | _dom_keyboard_event_create (struct dom_keyboard_event **evt) |
|
void | _dom_keyboard_event_destroy (struct dom_keyboard_event *evt) |
|
dom_exception | _dom_keyboard_event_initialise (struct dom_keyboard_event *evt) |
|
void | _dom_keyboard_event_finalise (struct dom_keyboard_event *evt) |
|
dom_exception | _dom_keyboard_event_get_key (dom_keyboard_event *evt, dom_string **key) |
|
dom_exception | _dom_keyboard_event_get_code (dom_keyboard_event *evt, dom_string **code) |
|
dom_exception | _dom_keyboard_event_get_location (dom_keyboard_event *evt, dom_key_location *location) |
|
dom_exception | _dom_keyboard_event_get_ctrl_key (dom_keyboard_event *evt, bool *key) |
|
dom_exception | _dom_keyboard_event_get_shift_key (dom_keyboard_event *evt, bool *key) |
|
dom_exception | _dom_keyboard_event_get_alt_key (dom_keyboard_event *evt, bool *key) |
|
dom_exception | _dom_keyboard_event_get_meta_key (dom_keyboard_event *evt, bool *key) |
|
dom_exception | _dom_keyboard_event_get_modifier_state (dom_keyboard_event *evt, dom_string *m, bool *state) |
|
dom_exception | _dom_keyboard_event_init (dom_keyboard_event *evt, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, dom_string *key, dom_string *code, dom_key_location location, bool ctrl_key, bool shift_key, bool alt_key, bool meta_key, bool repeat, bool is_composing) |
|
dom_exception | _dom_keyboard_event_init_ns (dom_keyboard_event *evt, dom_string *namespace, dom_string *type, bool bubble, bool cancelable, struct dom_abstract_view *view, dom_string *key, dom_string *code, dom_key_location location, bool ctrl_key, bool shift_key, bool alt_key, bool meta_key, bool repeat, bool is_composing) |
|
dom_exception | _dom_parse_modifier_list (dom_string *modifier_list, uint32_t *modifier_state) |
|
◆ _dom_keyboard_event_create()
◆ _dom_keyboard_event_destroy()
◆ _dom_keyboard_event_finalise()
◆ _dom_keyboard_event_get_alt_key()
Get the alt key state
- Parameters
-
evt | The Event object |
key | Whether the Alt key is pressed down |
- Returns
- DOM_NO_ERR.
◆ _dom_keyboard_event_get_code()
Get the code
- Parameters
-
evt | The Event object |
code | The returned code |
- Returns
- DOM_NO_ERR.
◆ _dom_keyboard_event_get_ctrl_key()
Get the ctrl key state
- Parameters
-
evt | The Event object |
key | Whether the Control key is pressed down |
- Returns
- DOM_NO_ERR.
◆ _dom_keyboard_event_get_key()
Get the key
- Parameters
-
evt | The Event object |
key | The returned key |
- Returns
- DOM_NO_ERR.
◆ _dom_keyboard_event_get_location()
Get the key location
- Parameters
-
evt | The Event object |
location | The returned key location |
- Returns
- DOM_NO_ERR.
◆ _dom_keyboard_event_get_meta_key()
Get the meta key state
- Parameters
-
evt | The Event object |
key | Whether the Meta key is pressed down |
- Returns
- DOM_NO_ERR.
◆ _dom_keyboard_event_get_modifier_state()
Query the state of a modifier using a key identifier
- Parameters
-
evt | The event object |
ml | The modifier identifier, such as "Alt", "Control", "Meta", "AltGraph", "CapsLock", "NumLock", "Scroll", "Shift". |
state | Whether the modifier key is pressed |
- Returns
- DOM_NO_ERR on success, appropriate dom_exception on failure.
- Note
- : If an application wishes to distinguish between right and left modifiers, this information could be deduced using keyboard events and KeyboardEvent.keyLocation.
◆ _dom_keyboard_event_get_shift_key()
Get the shift key state
- Parameters
-
evt | The Event object |
key | Whether the Shift key is pressed down |
- Returns
- DOM_NO_ERR.
◆ _dom_keyboard_event_init()
dom_exception _dom_keyboard_event_init |
( |
dom_keyboard_event * | evt, |
|
|
dom_string * | type, |
|
|
bool | bubble, |
|
|
bool | cancelable, |
|
|
struct dom_abstract_view * | view, |
|
|
dom_string * | key, |
|
|
dom_string * | code, |
|
|
dom_key_location | location, |
|
|
bool | ctrl_key, |
|
|
bool | shift_key, |
|
|
bool | alt_key, |
|
|
bool | meta_key, |
|
|
bool | repeat, |
|
|
bool | is_composing ) |
Initialise the keyboard event with namespace
- Parameters
-
evt | The Event object |
type | The event's type |
bubble | Whether this is a bubbling event |
cancelable | Whether this is a cancelable event |
view | The AbstractView associated with this event |
key | The key identifier of pressed key |
code | The code identifier of pressed key |
location | The key location of the preesed key |
ctrl_key | Whether the ctrl_key is pressed |
shift_key | Whether the shift_key is pressed |
alt_key | Whether the alt_key is pressed |
meta_key | Whether the ctrl_key is pressed |
repeat | Whether this is a repeat press from a held key |
is_composing | Whether the input is being composed |
- Returns
- DOM_NO_ERR on success, appropriate dom_exception on failure.
◆ _dom_keyboard_event_init_ns()
dom_exception _dom_keyboard_event_init_ns |
( |
dom_keyboard_event * | evt, |
|
|
dom_string * | namespace, |
|
|
dom_string * | type, |
|
|
bool | bubble, |
|
|
bool | cancelable, |
|
|
struct dom_abstract_view * | view, |
|
|
dom_string * | key, |
|
|
dom_string * | code, |
|
|
dom_key_location | location, |
|
|
bool | ctrl_key, |
|
|
bool | shift_key, |
|
|
bool | alt_key, |
|
|
bool | meta_key, |
|
|
bool | repeat, |
|
|
bool | is_composing ) |
Initialise the keyboard event with namespace
- Parameters
-
evt | The Event object |
namespace | The namespace of this event |
type | The event's type |
bubble | Whether this is a bubbling event |
cancelable | Whether this is a cancelable event |
view | The AbstractView associated with this event |
key | The key identifier of pressed key |
code | The code identifier of pressed key |
location | The key location of the preesed key |
ctrl_key | Whether the ctrl_key is pressed |
shift_key | Whether the shift_key is pressed |
alt_key | Whether the alt_key is pressed |
meta_key | Whether the ctrl_key is pressed |
repeat | Whether this is a repeat press from a held key |
is_composing | Whether the input is being composed |
- Returns
- DOM_NO_ERR on success, appropriate dom_exception on failure.
◆ _dom_keyboard_event_initialise()
◆ _dom_parse_modifier_list()
Parse the modifier list string to corresponding bool variable state
- Parameters
-
modifier_list | The modifier list string |
modifier_state | The returned state |
- Returns
- DOM_NO_ERR on success, appropriate dom_exception on failure.