Skip to content

Commit

Permalink
Merge pull request #10437 from keymanapp/fix/web/legacy-kbd-modifier-…
Browse files Browse the repository at this point in the history
…tracking

fix(web): osk responsiveness to held modifiers on legacy kbds 🧓
  • Loading branch information
jahorton authored Jan 23, 2024
2 parents 18339ef + 010f0b9 commit f08921f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web/src/app/browser/src/hardwareEventKeyboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,13 @@ export function preprocessKeyboardEvent(e: KeyboardEvent, keyboardState: Keyboar
}
/* 13/03/2007 MCD: Swedish: End mapping of keystroke to US keyboard */

if(!activeKeyboard.definesPositionalOrMnemonic && !(s.Lmodifiers & 0x60)) {
// The second conditional component (re 0x60): if CTRL or ALT is held down...
// Do not remap for legacy keyboard compatibility, do not pass Go, do not collect $200.
// This effectively only permits `default` and `shift` for legacy keyboards.
//
// Third: DO, however, track direct presses of any main modifier key. The OSK should
// reflect the current modifier state even for legacy keyboards.
if(!activeKeyboard.definesPositionalOrMnemonic && !(s.Lmodifiers & 0x60) && !s.isModifier) {
// Support version 1.0 KeymanWeb keyboards that do not define positional vs mnemonic
s = new KeyEvent({
Lcode: KeyMapping._USKeyCodeToCharCode(s),
Expand Down

0 comments on commit f08921f

Please sign in to comment.