diff options
Diffstat (limited to 'ppapi/thunk/ppb_input_event_thunk.cc')
-rw-r--r-- | ppapi/thunk/ppb_input_event_thunk.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/ppapi/thunk/ppb_input_event_thunk.cc b/ppapi/thunk/ppb_input_event_thunk.cc index 388b011..78b9cd1 100644 --- a/ppapi/thunk/ppb_input_event_thunk.cc +++ b/ppapi/thunk/ppb_input_event_thunk.cc @@ -271,6 +271,27 @@ const PPB_KeyboardInputEvent g_ppb_keyboard_input_event_thunk = { &GetCharacterText }; +// _Dev interface. + +PP_Bool SetUsbKeyCode(PP_Resource key_event, uint32_t usb_key_code) { + EnterInputEvent enter(key_event, true); + if (enter.failed()) + return PP_FALSE; + return enter.object()->SetUsbKeyCode(usb_key_code); +} + +uint32_t GetUsbKeyCode(PP_Resource key_event) { + EnterInputEvent enter(key_event, true); + if (enter.failed()) + return 0; + return enter.object()->GetUsbKeyCode(); +} + +const PPB_KeyboardInputEvent_Dev g_ppb_keyboard_input_event_dev_thunk = { + &SetUsbKeyCode, + &GetUsbKeyCode, +}; + // Composition ----------------------------------------------------------------- PP_Bool IsIMEInputEvent(PP_Resource resource) { @@ -347,6 +368,11 @@ const PPB_KeyboardInputEvent_1_0* GetPPB_KeyboardInputEvent_1_0_Thunk() { return &g_ppb_keyboard_input_event_thunk; } +const PPB_KeyboardInputEvent_Dev_0_1* + GetPPB_KeyboardInputEvent_Dev_0_1_Thunk() { + return &g_ppb_keyboard_input_event_dev_thunk; +} + const PPB_WheelInputEvent_1_0* GetPPB_WheelInputEvent_1_0_Thunk() { return &g_ppb_wheel_input_event_thunk; } |