Switch from text insertion to key press and release events on the virtual keyboard...
[chromium-blink-merge.git] / chrome / common / extensions / api / virtual_keyboard_private.json
blob12024fd24353a17bd54f2779fbd0024e42d3826b
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6   {
7     "namespace": "virtualKeyboardPrivate",
8     "platforms": ["chromeos"],
9     "description": "none",
10     "types": [
11       {
12         "id": "VirtualKeyboardEvent",
13         "type": "object",
14         "properties": {
15           "type": {"type": "string", "description": "One of keyup or keydown.", "enum": ["keyup", "keydown"]},
16           "charValue": {"type": "integer", "description": "Unicode value of the key."},
17           "keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."},
18           "shiftKey": {"type": "boolean", "optional": true, "description": "Whether or not the SHIFT key is pressed."}
19         }
20       }
21     ],
22     "functions": [
23       {
24         "name": "insertText",
25         "type": "function",
26         "description": "Inserts text into the currently focused text field.",
27         "parameters": [
28           { "name": "text",
29             "type": "string",
30             "description": "The text that will be inserted."
31           },
32           { "type": "function",
33             "name": "callback",
34             "optional": true,
35             "description": "Called when the insertion is completed.",
36             "parameters": []
37           }
38         ]
39       },
40       {
41         "name": "moveCursor",
42         "type": "function",
43         "description": "Move cursor on the current focused textfield by swipe.",
44         "parameters": [
45           { "name": "swipe_direction",
46             "type": "integer",
47             "discription": "The direction of the cursor movement."
48           },
49           { "name": "modifier_flags",
50             "type": "integer",
51             "description": "Bitmask representing the state of the system modifier keys."
52           },
53           { "type": "function",
54             "name": "callback",
55             "optional": true,
56             "decription": "called when the swipe movement is completed.",
57             "parameters": []
58           }
59         ]
60       },
61       {
62         "name": "sendKeyEvent",
63         "type": "function",
64         "description": "Sends a fabricated key event to the focused input field.",
65         "parameters": [
66           { "name": "keyEvent",
67             "$ref": "VirtualKeyboardEvent",
68             "description": ""
69           },
70           { "name": "callback",
71             "type": "function",
72             "optional": true,
73             "description": "Called after processing the event.",
74             "parameters": []
75           }
76         ]
77       }
78     ]
79   }