| // 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": "chrome/browser/extensions/api/input/input.h" |
| }, |
| "platforms": ["chromeos"], |
| "description": "none", |
| "types": [ |
| { |
| "id": "VirtualKeyboardEvent", |
| "type": "object", |
| "properties": { |
| "type": {"type": "string", "description": "One of keyup or keydown.", "enum": ["keyup", "keydown"]}, |
| "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."}, |
| "modifiers": {"type": "integer", "optional": true, "description": "Flag for modifiers that are active. None = 0, Shift = 2, Control = 4, Alt = 8."} |
| } |
| } |
| ], |
| "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": "moveCursor", |
| "type": "function", |
| "description": "Move cursor on the current focused textfield by swipe.", |
| "parameters": [ |
| { "name": "swipe_direction", |
| "type": "integer", |
| "discription": "The direction of the cursor movement." |
| }, |
| { "name": "modifier_flags", |
| "type": "integer", |
| "description": "Bitmask representing the state of the system modifier keys." |
| }, |
| { "type": "function", |
| "name": "callback", |
| "optional": true, |
| "decription": "called when the swipe movement 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": "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": [] |
| } |
| ] |
| } |
| ], |
| "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": { |
| "type": "string", |
| "description": "The value of type attribute of the focused text input box.", |
| "enum": ["text", "number", "password", "date", "url", "tel", "email"] |
| } |
| } |
| } |
| ] |
| } |
| ] |
| } |
| ] |