Data Fields
| 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, struct PP_Var code) |
| PP_Bool(* | IsKeyboardInputEvent )(PP_Resource resource) |
| uint32_t(* | GetKeyCode )(PP_Resource key_event) |
| struct PP_Var(* | GetCharacterText )(PP_Resource character_event) |
| struct PP_Var(* | GetCode )(PP_Resource key_event) |
Detailed Description
The PPB_KeyboardInputEvent interface contains pointers to several functions related to keyboard input events.
Field Documentation
| 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, struct PP_Var code) |
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] instance The instance for which this event occurred. [in] type A PP_InputEvent_Typeidentifying the type of input event.[in] time_stamp A PP_TimeTicksindicating the time when the event occurred.[in] modifiers A bit field combination of the PP_InputEvent_Modifierflags.[in] key_code This value reflects the DOM KeyboardEvent keyCodefield, which is the Windows-style Virtual Key code of the key.[in] character_text This value represents the typed character as a UTF-8 string. [in] code This value represents the DOM3 |code| string that corresponds to the physical key being pressed.
- Returns:
- A
PP_Resourcecontaining 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_event A PP_Resourcecorresponding 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.
struct PP_Var(* PPB_KeyboardInputEvent::GetCode)(PP_Resource key_event) [read] |
GetCode() returns the DOM |code| field for this keyboard event, as defined in the DOM3 Events spec: http://www.w3.org/TR/DOM-Level-3-Events/.
- Parameters:
[in] key_event The key event for which to return the key code.
- Returns:
- The string that contains the DOM |code| for the keyboard event.
| uint32_t(* PPB_KeyboardInputEvent::GetKeyCode)(PP_Resource key_event) |
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_event A PP_Resourcecorresponding to a keyboard event.
- Returns:
- The DOM keyCode field for the keyboard event.
IsKeyboardInputEvent() determines if a resource is a keyboard event.
- Parameters:
[in] resource A PP_Resourcecorresponding to an event.
- Returns:
PP_TRUEif the given resource is a valid input event.
The documentation for this struct was generated from the following file: