|
|
@ -74,8 +74,8 @@ export class InputHelper { |
|
|
|
|
|
|
|
|
public static subscribeKeyEvents( |
|
|
public static subscribeKeyEvents( |
|
|
element: HTMLInputElement, |
|
|
element: HTMLInputElement, |
|
|
keyDownCallback: (code: string, key: string, modifiers: RawInputModifiers) => boolean, |
|
|
keyDownCallback: (code: string, key: string, modifiers: string) => boolean, |
|
|
keyUpCallback: (code: string, key: string, modifiers: RawInputModifiers) => boolean) { |
|
|
keyUpCallback: (code: string, key: string, modifiers: string) => boolean) { |
|
|
const keyDownHandler = (args: KeyboardEvent) => { |
|
|
const keyDownHandler = (args: KeyboardEvent) => { |
|
|
if (keyDownCallback(args.code, args.key, this.getModifiers(args))) { |
|
|
if (keyDownCallback(args.code, args.key, this.getModifiers(args))) { |
|
|
if (this.clipboardState !== ClipboardState.Pending) { |
|
|
if (this.clipboardState !== ClipboardState.Pending) { |
|
|
@ -316,7 +316,7 @@ export class InputHelper { |
|
|
inputElement.style.width = `${inputElement.scrollWidth}px`; |
|
|
inputElement.style.width = `${inputElement.scrollWidth}px`; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private static getModifiers(args: KeyboardEvent): RawInputModifiers { |
|
|
private static getModifiers(args: KeyboardEvent): string { |
|
|
let modifiers = RawInputModifiers.None; |
|
|
let modifiers = RawInputModifiers.None; |
|
|
|
|
|
|
|
|
if (args.ctrlKey) { modifiers |= RawInputModifiers.Control; } |
|
|
if (args.ctrlKey) { modifiers |= RawInputModifiers.Control; } |
|
|
@ -324,7 +324,7 @@ export class InputHelper { |
|
|
if (args.shiftKey) { modifiers |= RawInputModifiers.Shift; } |
|
|
if (args.shiftKey) { modifiers |= RawInputModifiers.Shift; } |
|
|
if (args.metaKey) { modifiers |= RawInputModifiers.Meta; } |
|
|
if (args.metaKey) { modifiers |= RawInputModifiers.Meta; } |
|
|
|
|
|
|
|
|
return modifiers; |
|
|
return modifiers.toString(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static setPointerCapture(containerElement: HTMLInputElement, pointerId: number): void { |
|
|
public static setPointerCapture(containerElement: HTMLInputElement, pointerId: number): void { |
|
|
|