/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/**
* This file defines the PPB_KeyboardInputEvent_Dev
interface,
* which provides access to USB key codes that identify the physical key being
* pressed.
*/
label Chrome {
M31 = 0.2
};
/**
* The PPB_KeyboardInputEvent_Dev
interface is an extension to the
* PPB_KeyboardInputEvent interface that provides
*/
[macro="PPB_KEYBOARD_INPUT_EVENT_DEV_INTERFACE"]
interface PPB_KeyboardInputEvent_Dev {
/**
* This sets a USB key code in the given PP_Resource
. It is
* intended that this method be called immediately after any call to
* Create
.
*
* @param[in] key_event A PP_Resource
created by
* PPB_KeyboardInputEvent
's Create
method.
*
* @param[in] usb_key_code The USB key code to associate with this
* key_event
.
*
* @return PP_TRUE
if the USB key code was set successfully.
*/
PP_Bool SetUsbKeyCode([in] PP_Resource key_event,
[in] uint32_t usb_key_code);
/**
* GetUsbKeyCode() returns the USB key code associated with this keyboard
* event.
*
* @param[in] key_event The key event for which to return the key code.
*
* @return The USB key code field for the keyboard event. If there is no
* USB scancode associated with this event, or if the PP_Resource does not
* support the PPB_InputEvent_API (i.e., it is not an input event), then
* a 0 is returned.
*/
uint32_t GetUsbKeyCode([in] PP_Resource key_event);
/**
* GetCode() returns the DOM |code| field for this keyboard event, as
* defined by the UI Events spec: http://www.w3.org/TR/uievents/
*
* @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.
*/
PP_Var GetCode([in] PP_Resource key_event);
};