summaryrefslogtreecommitdiffstats
path: root/chromium/ppapi/api/dev/ppb_keyboard_input_event_dev.idl
blob: 0612b99411daa7e9b7dfc0f17e9c3aa47f7b3f8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* 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 <code>PPB_KeyboardInputEvent_Dev</code> interface,
 * which provides access to USB key codes that identify the physical key being
 * pressed.
 */

label Chrome {
  M31 = 0.2
};

/**
 * The <code>PPB_KeyboardInputEvent_Dev</code> interface is an extension to the
 * PPB_KeyboardInputEvent</code> interface that provides
 */
[macro="PPB_KEYBOARD_INPUT_EVENT_DEV_INTERFACE"]
interface PPB_KeyboardInputEvent_Dev {
  /**
   * This sets a USB key code in the given <code>PP_Resource</code>. It is
   * intended that this method be called immediately after any call to
   * <code>Create</code>.
   *
   * @param[in] key_event A <code>PP_Resource</code> created by
   * <code>PPB_KeyboardInputEvent</code>'s <code>Create</code> method.
   *
   * @param[in] usb_key_code The USB key code to associate with this
   * <code>key_event</code>.
   *
   * @return <code>PP_TRUE</code> 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);
};