mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 16:35:33 +00:00
27 lines
No EOL
954 B
TypeScript
27 lines
No EOL
954 B
TypeScript
namespace com.keyman.text {
|
|
// Represents a probability distribution over a keyboard's keys.
|
|
// Defined here to avoid compilation issues.
|
|
export type KeyDistribution = {keyId: string, p: number}[];
|
|
|
|
/**
|
|
* This class is defined within its own file so that it can be loaded by code outside of KMW without
|
|
* having to actually load the entirety of KMW.
|
|
*/
|
|
export class KeyEvent {
|
|
Ltarg: HTMLElement;
|
|
Lcode: number;
|
|
Lstates: number;
|
|
LmodifierChange?: boolean;
|
|
Lmodifiers: number;
|
|
LisVirtualKey: boolean;
|
|
vkCode: number;
|
|
kName: string;
|
|
kLayer?: string; // The key's layer property
|
|
kbdLayer?: string; // The virtual keyboard's active layer
|
|
kNextLayer?: string;
|
|
// Holds relevant event properties leading to construction of this KeyEvent.
|
|
source?: KeyEvent|MouseEvent|Touch;
|
|
// Holds a generated fat-finger distribution (when appropriate)
|
|
keyDistribution?: KeyDistribution;
|
|
};
|
|
} |