mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-14 20:59:25 +00:00
Fixes hardware-based mnemonic input for the sil_ipa keyboard w US layout
This commit is contained in:
parent
e96be2d4e1
commit
cf87c39fe6
1 changed files with 17 additions and 0 deletions
|
|
@ -492,6 +492,22 @@ namespace com.keyman {
|
|||
if (s.Lcode == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var activeKeyboard = this.keyman.keyboardManager.activeKeyboard;
|
||||
if(activeKeyboard && activeKeyboard['KM']) {
|
||||
// So long as the key name isn't prefixed with 'U_', we'll get a default mapping based on the Lcode value.
|
||||
// We need to determine the mnemonic base character - for example, SHIFT + K_PERIOD needs to map to '>'.
|
||||
var mappedChar: string = this.keyman.osk.defaultKeyOutput('K_xxxx', s.Lcode, (e.getModifierState("Shift") ? 0x10 : 0), false, null);
|
||||
if(mappedChar) {
|
||||
s.Lcode = mappedChar.charCodeAt(0);
|
||||
if(s.Lcode >= 'a'.charCodeAt(0) && s.Lcode <= 'z'.charCodeAt(0)) {
|
||||
// Apply an uppercase effect to the key, since K_A etc are based on the upper-case character codes.
|
||||
s.Lcode -= 32;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Stage 1 - track the true state of the keyboard's modifiers.
|
||||
var osk = this.keyman.osk, prevModState = DOMEventHandlers.states.modStateFlags, curModState = 0x0000;
|
||||
|
|
@ -727,6 +743,7 @@ namespace com.keyman {
|
|||
}
|
||||
else {
|
||||
DOMEventHandlers.states._KeyPressToSwallow = 0;
|
||||
LeventMatched = LeventMatched || kbdInterface.processKeystroke(util.physicalDevice,Levent.Ltarg,Levent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue