namespace com.keyman { class Hotkey { code: number; shift: number; handler: () => void constructor(code: number, shift: number, handler: () => void) { this.code = code; this.shift = shift; this.handler = handler; } matches(keyCode: number, shiftState: number): boolean { return (this.code == keyCode && this.shift == shiftState); } } export class HotkeyManager { keyman: KeymanBase; hotkeys: Hotkey[] = []; constructor(keyman: KeymanBase) { this.keyman = keyman; } /** * Function addHotkey * Scope Public * @param {number} keyCode * @param {number} shiftState * @param {function(Object)} handler * Description Add hot key handler to array of document-level hotkeys triggered by key up event */ addHotKey(keyCode: number, shiftState: number, handler: () => void) { // Test if existing handler for this code and replace it if so for(var i=0; i boolean = function(e: KeyboardEvent) { if(!e) { e = window.event as KeyboardEvent; } var _Lcode = this.keyman.domManager.nonTouchHandlers._GetEventKeyCode(e); if(_Lcode == null) { return false; } // Removed testing of e.shiftKey==null I3363 (Build 301) var _Lmodifiers = (e.shiftKey ? 0x10 : 0) | (e.ctrlKey ? 0x20 : 0) | (e.altKey ? 0x40 : 0); for(var i=0; i