chore(web): applies PR suggestion

Co-authored-by: Marc Durdin <marc@durdin.net>
This commit is contained in:
Joshua Horton 2021-07-12 05:29:37 +07:00 • committed by jahorton
parent 8b9066e109
commit 9933b76ea3

View file

@ -220,18 +220,12 @@ namespace com.keyman.keyboards {
// If it's a state key modifier, trigger its effects as part of the
// keystroke.
let bitmask = 0;
switch(Lkc.kName) {
case 'K_CAPS':
bitmask = text.Codes.stateBitmasks.CAPS;
break;
case 'K_NUMLOCK':
bitmask = text.Codes.stateBitmasks.NUM_LOCK;
break;
case 'K_SCROLL':
bitmask = text.Codes.stateBitmasks.SCROLL_LOCK;
break;
}
const bitmap = {
'K_CAPS': text.Codes.stateBitmasks.CAPS,
'K_NUMLOCK': text.Codes.stateBitmasks.NUM_LOCK,
'K_SCROLL': text.Codes.stateBitmasks.SCROLL_LOCK
};
const bitmask = bitmap[Lkc.kName];
if(bitmask) {
Lkc.Lstates ^= bitmask;
@ -690,4 +684,4 @@ namespace com.keyman.keyboards {
return aLayout;
}
}
}
}