summaryrefslogtreecommitdiff
path: root/chromium/extensions/common/api/virtual_keyboard_private.json
blob: 5b335fb2a55205856e4ff5452f19e1a55d10046d (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
// Copyright 2013 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.

[
  {
    "namespace": "virtualKeyboardPrivate",
    "compiler_options": {
      "implemented_in": "extensions/browser/api/virtual_keyboard_private/virtual_keyboard_private_api.h"
    },
    "platforms": ["chromeos"],
    "description": "none",
    "types": [
      {
        "id": "VirtualKeyboardEventType",
        "type": "string",
        "description": "One of keyup or keydown.",
        "enum": ["keyup", "keydown"]
      },
      {
        "id": "VirtualKeyboardEvent",
        "type": "object",
        "properties": {
          "type": {"$ref": "VirtualKeyboardEventType"},
          "charValue": {"type": "integer", "description": "Unicode value of the key."},
          "keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."},
          "keyName": {"type": "string", "description": "Name of the key, which is independent of modifier state."},
          "modifiers": {"type": "integer", "optional": true, "description": "Flag for modifiers that are active. None = 0, Shift = 2, Control = 4, Alt = 8."}
        }
      },
      {
        "id": "KeyboardMode",
        "type": "string",
        "enum": [ "FULL_WIDTH", "FLOATING" ],
        "description": "The value of the virtual keyboard mode to set to."
      },
      {
        "id": "KeyboardState",
        "type": "string",
        "enum": [ "ENABLED", "DISABLED", "AUTO"],
        "description": "The value of the virtual keyboard state to change to."
      },
      {
        "id": "OnTextInputBoxFocusedType",
        "type": "string",
        "description": "The value of type attribute of the focused text input box.",
        "enum": ["text", "number", "password", "date", "url", "tel", "email"]
      },
      {
        "id": "Bounds",
        "type": "object",
        "properties": {
          "left": {"type": "integer", "description": "The position of the virtual keyboard window's left edge."},
          "top": {"type": "integer", "description": "The position of the virtual keyboard window's top edge."},
          "width": {"type": "integer", "description": "The width of the virtual keyboard window."},
          "height": {"type": "integer", "description": "The height of the virtual keyboard window."}
        }
      }
    ],
    "functions": [
      {
        "name": "insertText",
        "type": "function",
        "description": "Inserts text into the currently focused text field.",
        "parameters": [
          { "name": "text",
            "type": "string",
            "description": "The text that will be inserted."
          },
          { "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the insertion is completed.",
            "parameters": []
          }
        ]
      },
      {
        "name": "sendKeyEvent",
        "type": "function",
        "description": "Sends a fabricated key event to the focused input field.",
        "parameters": [
          { "name": "keyEvent",
            "$ref": "VirtualKeyboardEvent",
            "description": ""
          },
          { "name": "callback",
            "type": "function",
            "optional": true,
            "description": "Called after processing the event.",
            "parameters": []
          }
        ]
      },
      {
        "name": "hideKeyboard",
        "type": "function",
        "description": "Hides the virtual keyboard.",
        "parameters": [
          { "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when the keyboard is hidden.",
            "parameters": []
          }
        ]
      },
      {
        "name": "setHotrodKeyboard",
        "type": "function",
        "description": "Sets the state of the hotrod virtual keyboard. This API should only be used by hotrod.",
        "parameters": [
          {
            "type": "boolean",
            "name": "enable"
          }
        ]
      },
      {
        "name": "lockKeyboard",
        "type": "function",
        "description": "Sets the lock state of the virtual keyboard. A locked keyboard remains visible even after a text area loses input focus.",
        "parameters": [
          {
            "type": "boolean",
            "name": "lock"
          }
        ]
      },
      {
        "name": "keyboardLoaded",
        "type": "function",
        "description": "Inform the system that the keyboard has loaded.",
        "parameters": [
          { "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when load acknowledgement is complete.",
            "parameters": []
          }
        ]
      },
      {
        "name": "getKeyboardConfig",
        "type": "function",
        "description": "Gets the virtual keyboard configuration.",
        "parameters": [
          {
            "type": "function",
            "name": "callback",
            "optional": true,
            "description": "Called when querying virtual keyboard configuration is complete.",
            "parameters": [
              {
                "type": "object",
                "name": "config",
                "properties": {
                  "layout": {
                    "type": "string",
                    "minLength": 1,
                    "description": "Virtual keyboard layout string."
                  },
                  "a11ymode": {
                    "type": "boolean",
                    "description": "True if accessibility virtual keyboard is enabled."
                  },
                  "features": {
                    "type": "array",
                    "items": { "type": "string" },
                    "description": "List of experimental feature flags."
                  }
                }
              }
            ]
          }
        ]
      },
      {
        "name": "openSettings",
        "type": "function",
        "description": "Opens chrome://settings/languages page.",
        "parameters": [
        ]
      },
      {
        "name": "setMode",
        "type": "function",
        "description": "Sets the virtual keyboard mode.",
        "parameters": [
          {
            "$ref": "KeyboardMode",
            "name": "mode",
            "description": "The value of the virtual keyboard mode to set to."
          }
        ]
      },
      {
        "name": "setKeyboardState",
        "type": "function",
        "description": "Requests the virtual keyboard to change state.",
        "parameters": [
          {
            "$ref": "KeyboardState",
            "name": "state",
            "description": "The value of the virtual keyboard state to change to."
          }
        ]
      }

    ],
    "events": [
      {
        "name": "onTextInputBoxFocused",
        "type": "function",
        "description": "This event is sent when focus enters a text input box.",
        "parameters": [
          {
            "type": "object",
            "name": "context",
            "description": "Describes the text input box that has acquired focus. Note only the type of text input box is passed. This API is intended to be used by non-ime virtual keyboard only. Normal ime virtual keyboard should use chrome.input.ime.onFocus to get the more detailed InputContext.",
            "properties": {
              "type": {
                "$ref": "OnTextInputBoxFocusedType",
                "description": "The value of type attribute of the focused text input box."
              }
            }
          }
        ]
      },
      {
        "name": "onBoundsChanged",
        "type": "function",
        "description": "This event is sent when virtual keyboard bounds changed and overscroll/resize is enabled.",
        "parameters": [
          {
            "name": "bounds",
            "description": "The virtual keyboard bounds",
            "$ref": "Bounds"
          }
        ]
      }
    ]
  }
]