mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-23 00:37:41 +00:00
docs(web): for 'On-Screen Keyboard Module'
This commit is contained in:
parent
2308ddfa50
commit
d042dede8b
3 changed files with 46 additions and 14 deletions
|
|
@ -633,8 +633,12 @@ export default class KeymanEngine extends KeymanEngineBase<BrowserConfiguration,
|
|||
* @param {string=} argFormFactor layout form factor, defaulting to 'desktop'
|
||||
* @param {(string|number)=} argLayerId name or index of layer to show, defaulting to 'default'
|
||||
* @return {Object} DIV object with filled keyboard layer content
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/BuildVisualKeyboard
|
||||
*
|
||||
* (May be moved to https://help.keyman.com/developer/engine/web/17.0/reference/core/BuildVisualKeyboard)
|
||||
*/
|
||||
BuildVisualKeyboard(
|
||||
public BuildVisualKeyboard(
|
||||
PInternalName: string,
|
||||
Pstatic: number,
|
||||
argFormFactor?: DeviceSpec.FormFactor,
|
||||
|
|
|
|||
|
|
@ -144,8 +144,10 @@ export default class FloatingOSKView extends OSKView {
|
|||
* @param {boolean?} keepDefaultPosition If true, does not reset the default x,y set by `setRect`.
|
||||
* If false or omitted, resets the default x,y as well.
|
||||
* Description Move OSK back to default position, floating under active input element
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/restorePosition
|
||||
*/
|
||||
['restorePosition']: (keepDefaultPosition?: boolean) => void = function(this: FloatingOSKView, keepDefaultPosition?: boolean) {
|
||||
public restorePosition: (keepDefaultPosition?: boolean) => void = function(this: FloatingOSKView, keepDefaultPosition?: boolean) {
|
||||
let isVisible = this._Visible;
|
||||
|
||||
let dragPromise = new ManagedPromise<void>();
|
||||
|
|
@ -362,8 +364,10 @@ export default class FloatingOSKView extends OSKView {
|
|||
* and (optionally) override user repositioning or sizing
|
||||
*
|
||||
* @param {Object.<string,number>} p Array object with position and size of OSK container
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/setRect
|
||||
**/
|
||||
['setRect'](p: OSKRect) {
|
||||
public setRect(p: OSKRect) {
|
||||
if(this._Box == null || this.targetDevice.formFactor != 'desktop') {
|
||||
return;
|
||||
}
|
||||
|
|
@ -451,9 +455,11 @@ export default class FloatingOSKView extends OSKView {
|
|||
* Function setPos
|
||||
* Scope Private
|
||||
* @param {Object.<string,number>} p Array object with OSK left, top
|
||||
* Description Set position of OSK window, but limit to screen, and ignore if a touch input device
|
||||
* Description Set position of OSK window, but limit to screen
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/setPos
|
||||
*/
|
||||
['setPos'](p: OSKPos) {
|
||||
public setPos(p: OSKPos) {
|
||||
if(typeof(this._Box) == 'undefined') {
|
||||
return; // I3363 (Build 301)
|
||||
}
|
||||
|
|
@ -581,8 +587,10 @@ export default class FloatingOSKView extends OSKView {
|
|||
* Scope Public
|
||||
* @return {(boolean|number)} true if user located
|
||||
* Description Test if OSK window has been repositioned by user
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/userLocated
|
||||
*/
|
||||
['userLocated']() {
|
||||
public userLocated() {
|
||||
return this.userPositioned;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1132,8 +1132,10 @@ export default abstract class OSKView extends EventEmitter<EventMap> implements
|
|||
* Scope Public
|
||||
* @return {Object.<string,number>} Array object with position and size of OSK container
|
||||
* Description Get rectangle containing KMW Virtual Keyboard
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/getRect
|
||||
*/
|
||||
['getRect'](): OSKRect { // I2405
|
||||
public getRect(): OSKRect { // I2405
|
||||
var p: OSKRect = {};
|
||||
|
||||
// Always return these based upon _Box; using this.vkbd will fail to account for banner and/or
|
||||
|
|
@ -1165,8 +1167,10 @@ export default abstract class OSKView extends EventEmitter<EventMap> implements
|
|||
* Scope Public
|
||||
* @return {boolean|number} True if KMW OSK enabled
|
||||
* Description Test if KMW OSK is enabled
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/isEnabled
|
||||
*/
|
||||
['isEnabled'](): boolean {
|
||||
public isEnabled(): boolean {
|
||||
return this.displayIfActive;
|
||||
}
|
||||
|
||||
|
|
@ -1176,8 +1180,10 @@ export default abstract class OSKView extends EventEmitter<EventMap> implements
|
|||
* @return {boolean|number} True if KMW OSK visible
|
||||
* Description Test if KMW OSK is actually visible
|
||||
* Note that this will usually return false after any UI event that results in (temporary) loss of input focus
|
||||
*
|
||||
* https://help.keyman.com/developer/engine/web/17.0/reference/osk/isVisible
|
||||
*/
|
||||
['isVisible'](): boolean {
|
||||
public isVisible(): boolean {
|
||||
return this._Visible;
|
||||
}
|
||||
|
||||
|
|
@ -1185,8 +1191,10 @@ export default abstract class OSKView extends EventEmitter<EventMap> implements
|
|||
* Function hide
|
||||
* Scope Public
|
||||
* Description Prevent display of OSK window on focus
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/hide
|
||||
*/
|
||||
['hide']() {
|
||||
public hide() {
|
||||
this.activationModel.enabled = false;
|
||||
this.startHide(true);
|
||||
}
|
||||
|
|
@ -1196,8 +1204,10 @@ export default abstract class OSKView extends EventEmitter<EventMap> implements
|
|||
* Function show
|
||||
* Scope Public
|
||||
* @param {(boolean|number)=} bShow True to display, False to hide, omitted to toggle
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/show
|
||||
*/
|
||||
['show'](bShow?: boolean) {
|
||||
public show(bShow?: boolean) {
|
||||
if(arguments.length > 0) {
|
||||
this.activationModel.enabled = bShow;
|
||||
} else {
|
||||
|
|
@ -1238,17 +1248,27 @@ export default abstract class OSKView extends EventEmitter<EventMap> implements
|
|||
* Scope Public
|
||||
* @param {string} event event name
|
||||
* @param {function(Object)} func event handler
|
||||
* @return {boolean}
|
||||
* Description Wrapper function to add and identify OSK-specific event handlers
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/addEventListener
|
||||
*/
|
||||
addEventListener<T extends keyof LegacyOSKEventMap>(
|
||||
public addEventListener<T extends keyof LegacyOSKEventMap>(
|
||||
event: T,
|
||||
fn: EventListener<LegacyOSKEventMap, T>
|
||||
): void {
|
||||
this.legacyEvents.addEventListener(event, fn);
|
||||
}
|
||||
|
||||
removeEventListener<T extends keyof LegacyOSKEventMap>(
|
||||
/**
|
||||
* Function removeEventListener
|
||||
* Scope Public
|
||||
* @param {string} event event name
|
||||
* @param {function(Object)} func event handler
|
||||
* Description Wrapper function to remove previously-added OSK-specific event handlers
|
||||
*
|
||||
* See https://help.keyman.com/developer/engine/web/17.0/reference/osk/removeEventListener
|
||||
*/
|
||||
public removeEventListener<T extends keyof LegacyOSKEventMap>(
|
||||
event: T,
|
||||
fn: EventListener<LegacyOSKEventMap, T>
|
||||
): void {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue