change(web): remove broken redundant check for keys to not correct

This commit is contained in:
Joshua A. Horton 2024-05-29 10:22:28 +07:00
parent fec1bbc008
commit be1cc343ef
3 changed files with 3 additions and 10 deletions

View file

@ -81,7 +81,7 @@ export function correctionKeyFilter(key: ActiveKeyBase): boolean {
return false;
// Attempt to filter out known non-output keys.
// Results in a more optimized distribution.
} else if(Codes.isKnownOSKModifierKey(key.baseKeyID)) {
} else if(Codes.isKeyNotCorrected(key.baseKeyID)) {
return false;
} else if(key.isPadding) { // to the user, blank / padding keys do not exist.
return false;

View file

@ -199,7 +199,7 @@ export default class InputProcessor {
// If it's a key that we 'optimize out' of our fat-finger correction algorithm,
// we MUST NOT trigger it for this keystroke.
let isOnlyLayerSwitchKey = Codes.isKnownOSKModifierKey(keyEvent.kName);
let isOnlyLayerSwitchKey = Codes.isKeyNotCorrected(keyEvent.kName);
// Best-guess stopgap for possible custom modifier keys.
// If a key (1) does not affect the context and (2) shifts the active layer,

View file

@ -86,7 +86,7 @@ const Codes = {
[')!@#$%^&*(',':+<_>?~', '{|}"']
],
isKnownOSKModifierKey(keyID: string): boolean {
isKeyNotCorrected(keyID: string): boolean {
switch(keyID) {
case 'K_SHIFT':
case 'K_LOPT':
@ -98,13 +98,6 @@ const Codes = {
if(Codes.keyCodes[keyID] >= 50000) { // A few are used by `sil_euro_latin`.
return true; // is a 'K_' key defined for layer shifting or 'control' use.
}
// Refer to text/codes.ts - these are Keyman-custom "keycodes" used for
// layer shifting keys. To be safe, we currently let K_TABBACK and
// K_TABFWD through, though we might be able to drop them too.
const code = Codes[keyID];
if(code > 50000 && code < 50011) {
return true;
}
}
return false;