mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-12 11:55:32 +00:00
chore(web): refactor constructNullKeyEvent
This commit is contained in:
parent
3601ae95e4
commit
f9b4be6883
1 changed files with 12 additions and 15 deletions
|
|
@ -211,28 +211,25 @@ namespace com.keyman.text {
|
|||
}
|
||||
}
|
||||
|
||||
processNewContextEvent(device: utils.DeviceSpec, outputTarget: OutputTarget): RuleBehavior {
|
||||
if(!this.activeKeyboard) {
|
||||
return null;
|
||||
}
|
||||
let keyEvent = new KeyEvent();
|
||||
constructNullKeyEvent(device: utils.DeviceSpec): KeyEvent {
|
||||
const keyEvent = new KeyEvent();
|
||||
keyEvent.Lcode = 0;
|
||||
keyEvent.kName = '';
|
||||
keyEvent.device = device;
|
||||
this.setSyntheticEventDefaults(keyEvent);
|
||||
return this.keyboardInterface.processNewContextEvent(outputTarget, keyEvent);
|
||||
return keyEvent;
|
||||
}
|
||||
|
||||
processNewContextEvent(device: utils.DeviceSpec, outputTarget: OutputTarget): RuleBehavior {
|
||||
return this.activeKeyboard ?
|
||||
this.keyboardInterface.processNewContextEvent(outputTarget, this.constructNullKeyEvent(device)) :
|
||||
null;
|
||||
}
|
||||
|
||||
processPostKeystroke(device: utils.DeviceSpec, outputTarget: OutputTarget): RuleBehavior {
|
||||
if(!this.activeKeyboard) {
|
||||
return null;
|
||||
}
|
||||
let keyEvent = new KeyEvent();
|
||||
keyEvent.Lcode = 0;
|
||||
keyEvent.kName = '';
|
||||
keyEvent.device = device;
|
||||
this.setSyntheticEventDefaults(keyEvent);
|
||||
return this.keyboardInterface.processPostKeystroke(outputTarget, keyEvent);
|
||||
return this.activeKeyboard ?
|
||||
this.keyboardInterface.processPostKeystroke(outputTarget, this.constructNullKeyEvent(device)) :
|
||||
null;
|
||||
}
|
||||
|
||||
processKeystroke(keyEvent: KeyEvent, outputTarget: OutputTarget): RuleBehavior {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue