Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window.
Use the chrome.input.ime API to implement a custom IME for Chrome OS. This allows your extension to handle keystrokes, set the composition, and manage the candidate window. * available since Chrome 36 * https://developer.chrome.com/extensions/input.ime
(clear-composition parameters)
Clear the current composition. If this extension does not own the active IME, this fails.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-clearComposition-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [success] where:
|success| - https://developer.chrome.com/extensions/input.ime#property-callback-success.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-clearComposition.
Clear the current composition. If this extension does not own the active IME, this fails. |parameters| - https://developer.chrome.com/extensions/input.ime#property-clearComposition-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [success] where: |success| - https://developer.chrome.com/extensions/input.ime#property-callback-success. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-clearComposition.
(commit-text parameters)
Commits the provided text to the current input.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-commitText-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [success] where:
|success| - https://developer.chrome.com/extensions/input.ime#property-callback-success.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-commitText.
Commits the provided text to the current input. |parameters| - https://developer.chrome.com/extensions/input.ime#property-commitText-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [success] where: |success| - https://developer.chrome.com/extensions/input.ime#property-callback-success. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-commitText.
(delete-surrounding-text parameters)
Deletes the text around the caret.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-deleteSurroundingText-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-deleteSurroundingText.
Deletes the text around the caret. |parameters| - https://developer.chrome.com/extensions/input.ime#property-deleteSurroundingText-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-deleteSurroundingText.
(hide-input-view)
Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing.
https://developer.chrome.com/extensions/input.ime#method-hideInputView.
Hides the input view window, which is popped up automatically by system. If the input view window is already hidden, this function will do nothing. https://developer.chrome.com/extensions/input.ime#method-hideInputView.
(key-event-handled request-id response)
Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous.
|request-id| - Request id of the event that was handled. This should come from keyEvent.requestId |response| - True if the keystroke was handled, false if not
https://developer.chrome.com/extensions/input.ime#method-keyEventHandled.
Indicates that the key event received by onKeyEvent is handled. This should only be called if the onKeyEvent listener is asynchronous. |request-id| - Request id of the event that was handled. This should come from keyEvent.requestId |response| - True if the keystroke was handled, false if not https://developer.chrome.com/extensions/input.ime#method-keyEventHandled.
(on-assistive-window-button-clicked* config channel & args)
(send-key-events parameters)
Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-sendKeyEvents-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-sendKeyEvents.
Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system. |parameters| - https://developer.chrome.com/extensions/input.ime#property-sendKeyEvents-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-sendKeyEvents.
(set-assistive-window-button-highlighted parameters)
Highlights/Unhighlights a button in an assistive window.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-setAssistiveWindowButtonHighlighted-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-setAssistiveWindowButtonHighlighted.
Highlights/Unhighlights a button in an assistive window. |parameters| - https://developer.chrome.com/extensions/input.ime#property-setAssistiveWindowButtonHighlighted-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-setAssistiveWindowButtonHighlighted.
(set-assistive-window-button-highlighted* config parameters)
(set-assistive-window-properties parameters)
Shows/Hides an assistive window with the given properties.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-setAssistiveWindowProperties-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [success] where:
|success| - https://developer.chrome.com/extensions/input.ime#property-callback-success.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-setAssistiveWindowProperties.
Shows/Hides an assistive window with the given properties. |parameters| - https://developer.chrome.com/extensions/input.ime#property-setAssistiveWindowProperties-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [success] where: |success| - https://developer.chrome.com/extensions/input.ime#property-callback-success. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-setAssistiveWindowProperties.
(set-candidate-window-properties parameters)
Sets the properties of the candidate window. This fails if the extension doesn't own the active IME
|parameters| - https://developer.chrome.com/extensions/input.ime#property-setCandidateWindowProperties-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [success] where:
|success| - https://developer.chrome.com/extensions/input.ime#property-callback-success.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-setCandidateWindowProperties.
Sets the properties of the candidate window. This fails if the extension doesn't own the active IME |parameters| - https://developer.chrome.com/extensions/input.ime#property-setCandidateWindowProperties-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [success] where: |success| - https://developer.chrome.com/extensions/input.ime#property-callback-success. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-setCandidateWindowProperties.
(set-candidates parameters)
Sets the current candidate list. This fails if this extension doesn't own the active IME
|parameters| - https://developer.chrome.com/extensions/input.ime#property-setCandidates-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [success] where:
|success| - https://developer.chrome.com/extensions/input.ime#property-callback-success.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-setCandidates.
Sets the current candidate list. This fails if this extension doesn't own the active IME |parameters| - https://developer.chrome.com/extensions/input.ime#property-setCandidates-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [success] where: |success| - https://developer.chrome.com/extensions/input.ime#property-callback-success. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-setCandidates.
(set-composition parameters)
Set the current composition. If this extension does not own the active IME, this fails.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-setComposition-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [success] where:
|success| - https://developer.chrome.com/extensions/input.ime#property-callback-success.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-setComposition.
Set the current composition. If this extension does not own the active IME, this fails. |parameters| - https://developer.chrome.com/extensions/input.ime#property-setComposition-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [success] where: |success| - https://developer.chrome.com/extensions/input.ime#property-callback-success. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-setComposition.
(set-cursor-position parameters)
Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-setCursorPosition-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [success] where:
|success| - https://developer.chrome.com/extensions/input.ime#property-callback-success.
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-setCursorPosition.
Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME. |parameters| - https://developer.chrome.com/extensions/input.ime#property-setCursorPosition-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is [success] where: |success| - https://developer.chrome.com/extensions/input.ime#property-callback-success. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-setCursorPosition.
(set-menu-items parameters)
Adds the provided menu items to the language menu when this IME is active.
|parameters| - https://developer.chrome.com/extensions/input.ime#property-setMenuItems-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-setMenuItems.
Adds the provided menu items to the language menu when this IME is active. |parameters| - https://developer.chrome.com/extensions/input.ime#property-setMenuItems-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-setMenuItems.
(tap-all-events chan)
Taps all valid non-deprecated events in chromex.ext.input.ime namespace.
Taps all valid non-deprecated events in chromex.ext.input.ime namespace.
(tap-on-activate-events channel & args)
This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events.
Events will be put on the |channel| with signature [::on-activate [engine-id screen]] where:
|engine-id| - ID of the engine receiving the event |screen| - The screen type under which the IME is activated.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onActivate.
This event is sent when an IME is activated. It signals that the IME will be receiving onKeyPress events. Events will be put on the |channel| with signature [::on-activate [engine-id screen]] where: |engine-id| - ID of the engine receiving the event |screen| - The screen type under which the IME is activated. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onActivate.
(tap-on-assistive-window-button-clicked-events channel & args)
This event is sent when a button in an assistive window is clicked.
Events will be put on the |channel| with signature [::on-assistive-window-button-clicked [details]] where:
|details| - https://developer.chrome.com/extensions/input.ime#property-onAssistiveWindowButtonClicked-details.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onAssistiveWindowButtonClicked.
This event is sent when a button in an assistive window is clicked. Events will be put on the |channel| with signature [::on-assistive-window-button-clicked [details]] where: |details| - https://developer.chrome.com/extensions/input.ime#property-onAssistiveWindowButtonClicked-details. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onAssistiveWindowButtonClicked.
(tap-on-blur-events channel & args)
This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user.
Events will be put on the |channel| with signature [::on-blur [context-id]] where:
|context-id| - The ID of the text field that has lost focus. The ID is invalid after this call
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onBlur.
This event is sent when focus leaves a text box. It is sent to all extensions that are listening to this event, and enabled by the user. Events will be put on the |channel| with signature [::on-blur [context-id]] where: |context-id| - The ID of the text field that has lost focus. The ID is invalid after this call Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onBlur.
(tap-on-candidate-clicked-events channel & args)
This event is sent if this extension owns the active IME.
Events will be put on the |channel| with signature [::on-candidate-clicked [engine-id candidate-id button]] where:
|engine-id| - ID of the engine receiving the event |candidate-id| - ID of the candidate that was clicked. |button| - Which mouse buttons was clicked.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onCandidateClicked.
This event is sent if this extension owns the active IME. Events will be put on the |channel| with signature [::on-candidate-clicked [engine-id candidate-id button]] where: |engine-id| - ID of the engine receiving the event |candidate-id| - ID of the candidate that was clicked. |button| - Which mouse buttons was clicked. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onCandidateClicked.
(tap-on-deactivated-events channel & args)
This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events.
Events will be put on the |channel| with signature [::on-deactivated [engine-id]] where:
|engine-id| - ID of the engine receiving the event
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onDeactivated.
This event is sent when an IME is deactivated. It signals that the IME will no longer be receiving onKeyPress events. Events will be put on the |channel| with signature [::on-deactivated [engine-id]] where: |engine-id| - ID of the engine receiving the event Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onDeactivated.
(tap-on-focus-events channel & args)
This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user.
Events will be put on the |channel| with signature [::on-focus [context]] where:
|context| - Describes the text field that has acquired focus.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onFocus.
This event is sent when focus enters a text box. It is sent to all extensions that are listening to this event, and enabled by the user. Events will be put on the |channel| with signature [::on-focus [context]] where: |context| - Describes the text field that has acquired focus. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onFocus.
(tap-on-input-context-update-events channel & args)
This event is sent when the properties of the current InputContext change, such as the the type. It is sent to all extensions that are listening to this event, and enabled by the user.
Events will be put on the |channel| with signature [::on-input-context-update [context]] where:
|context| - An InputContext object describing the text field that has changed.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onInputContextUpdate.
This event is sent when the properties of the current InputContext change, such as the the type. It is sent to all extensions that are listening to this event, and enabled by the user. Events will be put on the |channel| with signature [::on-input-context-update [context]] where: |context| - An InputContext object describing the text field that has changed. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onInputContextUpdate.
(tap-on-key-event-events channel & args)
Fired when a key event is sent from the operating system. The event will be sent to the extension if this extension owns the active IME. The listener function should return true if the event was handled false if it was not. If the event will be evaluated asynchronously, this function must return undefined and the IME must later call keyEventHandled() with the result.
Events will be put on the |channel| with signature [::on-key-event [engine-id key-data request-id]] where:
|engine-id| - ID of the engine receiving the event |key-data| - Data on the key event |request-id| - ID of the request. If the event listener returns undefined, then keyEventHandled must be called later with this requestId.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onKeyEvent.
Fired when a key event is sent from the operating system. The event will be sent to the extension if this extension owns the active IME. The listener function should return true if the event was handled false if it was not. If the event will be evaluated asynchronously, this function must return undefined and the IME must later call keyEventHandled() with the result. Events will be put on the |channel| with signature [::on-key-event [engine-id key-data request-id]] where: |engine-id| - ID of the engine receiving the event |key-data| - Data on the key event |request-id| - ID of the request. If the event listener returns undefined, then keyEventHandled must be called later with this requestId. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onKeyEvent.
(tap-on-menu-item-activated-events channel & args)
Called when the user selects a menu item
Events will be put on the |channel| with signature [::on-menu-item-activated [engine-id name]] where:
|engine-id| - ID of the engine receiving the event |name| - Name of the MenuItem which was activated
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onMenuItemActivated.
Called when the user selects a menu item Events will be put on the |channel| with signature [::on-menu-item-activated [engine-id name]] where: |engine-id| - ID of the engine receiving the event |name| - Name of the MenuItem which was activated Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onMenuItemActivated.
(tap-on-reset-events channel & args)
This event is sent when chrome terminates ongoing text input session.
Events will be put on the |channel| with signature [::on-reset [engine-id]] where:
|engine-id| - ID of the engine receiving the event
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onReset.
This event is sent when chrome terminates ongoing text input session. Events will be put on the |channel| with signature [::on-reset [engine-id]] where: |engine-id| - ID of the engine receiving the event Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onReset.
(tap-on-surrounding-text-changed-events channel & args)
Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction.
Events will be put on the |channel| with signature [::on-surrounding-text-changed [engine-id surrounding-info]] where:
|engine-id| - ID of the engine receiving the event |surrounding-info| - The surrounding information.
Note: |args| will be passed as additional parameters into Chrome event's .addListener call.
https://developer.chrome.com/extensions/input.ime#event-onSurroundingTextChanged.
Called when the editable string around caret is changed or when the caret position is moved. The text length is limited to 100 characters for each back and forth direction. Events will be put on the |channel| with signature [::on-surrounding-text-changed [engine-id surrounding-info]] where: |engine-id| - ID of the engine receiving the event |surrounding-info| - The surrounding information. Note: |args| will be passed as additional parameters into Chrome event's .addListener call. https://developer.chrome.com/extensions/input.ime#event-onSurroundingTextChanged.
(update-menu-items parameters)
Updates the state of the MenuItems specified
|parameters| - https://developer.chrome.com/extensions/input.ime#property-updateMenuItems-parameters.
This function returns a core.async channel of type promise-chan
which eventually receives a result value.
Signature of the result value put on the channel is [].
In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.
https://developer.chrome.com/extensions/input.ime#method-updateMenuItems.
Updates the state of the MenuItems specified |parameters| - https://developer.chrome.com/extensions/input.ime#property-updateMenuItems-parameters. This function returns a core.async channel of type `promise-chan` which eventually receives a result value. Signature of the result value put on the channel is []. In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error. https://developer.chrome.com/extensions/input.ime#method-updateMenuItems.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close