Native Client

PPB_KeyboardInputEvent Struct Reference

The PPB_KeyboardInputEvent interface contains pointers to several functions related to keyboard input events. More...


Detailed Description

The PPB_KeyboardInputEvent interface contains pointers to several functions related to keyboard input events.

Data Fields List

PP_Resource(* Create )(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers, uint32_t key_code, struct PP_Var character_text)
PP_Bool(* IsKeyboardInputEvent )(PP_Resource resource)
uint32_t(* GetKeyCode )(PP_Resource key_event)
struct PP_Var(* GetCharacterText )(PP_Resource character_event)

Data Fields Details

PP_Resource(* PPB_KeyboardInputEvent::Create)(PP_Instance instance, PP_InputEvent_Type type, PP_TimeTicks time_stamp, uint32_t modifiers, uint32_t key_code, struct PP_Var character_text)

Creates a keyboard input event with the given parameters.

Normally you will get a keyboard event passed through the HandleInputEvent and will not need to create them, but some applications may want to create their own for internal use. The type must be one of the keyboard event types.

Parameters:
[in]instanceThe instance for which this event occurred.
[in]typeA PP_InputEvent_Type identifying the type of input event.
[in]time_stampA PP_TimeTicks indicating the time when the event occurred.
[in]modifiersA bit field combination of the PP_InputEvent_Modifier flags.
[in]key_codeThis value reflects the DOM KeyboardEvent keyCode field. Chrome populates this with the Windows-style Virtual Key code of the key.
[in]character_textThis value represents the typed character as a UTF-8 string.
Returns:
A PP_Resource containing the new keyboard input event.
struct PP_Var(* PPB_KeyboardInputEvent::GetCharacterText)(PP_Resource character_event) [read]

GetCharacterText() returns the typed character as a UTF-8 string for the given character event.

Parameters:
[in]character_eventA PP_Resource corresponding to a keyboard event.
Returns:
A string var representing a single typed character for character input events. For non-character input events the return value will be an undefined var.

GetKeyCode() returns the DOM keyCode field for the keyboard event.

Chrome populates this with the Windows-style Virtual Key code of the key.

Parameters:
[in]key_eventA PP_Resource corresponding to a keyboard event.
Returns:
The DOM keyCode field for the keyboard event.

IsKeyboardInputEvent() determines if a resource is a keyboard event.

Parameters:
[in]resourceA PP_Resource corresponding to an event.
Returns:
PP_TRUE if the given resource is a valid input event.

The documentation for this struct was generated from the following file:

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.