diff options
Diffstat (limited to 'ppapi/c/ppb_input_event.h')
-rw-r--r-- | ppapi/c/ppb_input_event.h | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/ppapi/c/ppb_input_event.h b/ppapi/c/ppb_input_event.h index 2624f0b..257d568 100644 --- a/ppapi/c/ppb_input_event.h +++ b/ppapi/c/ppb_input_event.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From ppb_input_event.idl modified Tue Jul 23 19:23:51 2013. */ +/* From ppb_input_event.idl modified Mon Dec 16 15:35:15 2013. */ #ifndef PPAPI_C_PPB_INPUT_EVENT_H_ #define PPAPI_C_PPB_INPUT_EVENT_H_ @@ -29,8 +29,9 @@ #define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 "PPB_KeyboardInputEvent;1.0" +#define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_2 "PPB_KeyboardInputEvent;1.2" #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \ - PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 + PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_2 #define PPB_TOUCH_INPUT_EVENT_INTERFACE_1_0 "PPB_TouchInputEvent;1.0" #define PPB_TOUCH_INPUT_EVENT_INTERFACE PPB_TOUCH_INPUT_EVENT_INTERFACE_1_0 @@ -330,7 +331,7 @@ struct PPB_InputEvent_1_0 { * the page. * * Note that synthetic mouse events will be generated from touch events if - * (and only if) the you do not request touch events. + * (and only if) you do not request touch events. * * When requesting input events through this function, the events will be * delivered and <i>not</i> bubbled to the page. This means that even if you @@ -695,7 +696,7 @@ typedef struct PPB_WheelInputEvent_1_0 PPB_WheelInputEvent; * The <code>PPB_KeyboardInputEvent</code> interface contains pointers to * several functions related to keyboard input events. */ -struct PPB_KeyboardInputEvent_1_0 { +struct PPB_KeyboardInputEvent_1_2 { /** * Creates a keyboard input event with the given parameters. Normally you * will get a keyboard event passed through the HandleInputEvent and will not @@ -710,16 +711,19 @@ struct PPB_KeyboardInputEvent_1_0 { * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time * when the event occurred. * - * @param[in] modifiers A bit field combination of the + * @param[in] modifiers A bit field combination of the * <code>PP_InputEvent_Modifier</code> flags. * * @param[in] key_code This value reflects the DOM KeyboardEvent - * <code>keyCode</code> field. Chrome populates this with the Windows-style - * Virtual Key code of the key. + * <code>keyCode</code> field, which is the Windows-style Virtual Key + * code of the key. * * @param[in] character_text This value represents the typed character as a * UTF-8 string. * + * @param[in] code This value represents the DOM3 |code| string that + * corresponds to the physical key being pressed. + * * @return A <code>PP_Resource</code> containing the new keyboard input * event. */ @@ -728,7 +732,8 @@ struct PPB_KeyboardInputEvent_1_0 { PP_TimeTicks time_stamp, uint32_t modifiers, uint32_t key_code, - struct PP_Var character_text); + struct PP_Var character_text, + struct PP_Var code); /** * IsKeyboardInputEvent() determines if a resource is a keyboard event. * @@ -759,9 +764,31 @@ struct PPB_KeyboardInputEvent_1_0 { * undefined var. */ struct PP_Var (*GetCharacterText)(PP_Resource character_event); + /** + * 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/ + * + * @param[in] key_event The key event for which to return the key code. + * + * @return The string that contains the DOM |code| for the keyboard event. + */ + struct PP_Var (*GetCode)(PP_Resource key_event); }; -typedef struct PPB_KeyboardInputEvent_1_0 PPB_KeyboardInputEvent; +typedef struct PPB_KeyboardInputEvent_1_2 PPB_KeyboardInputEvent; + +struct PPB_KeyboardInputEvent_1_0 { + 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); +}; /** * @} */ |