Skip to content

Commit

Permalink
change(web): isKeyNotCorrected -> isFrameKey
Browse files Browse the repository at this point in the history
  • Loading branch information
jahorton committed May 31, 2024
1 parent 8f35696 commit 5abd621
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common/web/input-processor/src/correctionLayout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.isKeyNotCorrected(key.baseKeyID)) {
} else if(Codes.isFrameKey(key.baseKeyID)) {
return false;
} else if(key.isPadding) { // to the user, blank / padding keys do not exist.
return false;
Expand Down
2 changes: 1 addition & 1 deletion common/web/input-processor/src/text/inputProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.isKeyNotCorrected(keyEvent.kName);
let isOnlyLayerSwitchKey = Codes.isFrameKey(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,
Expand Down
4 changes: 3 additions & 1 deletion common/web/keyboard-processor/src/text/codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ const Codes = {
[')!@#$%^&*(',':+<_>?~', '{|}"']
],

isKeyNotCorrected(keyID: string): boolean {
isFrameKey(keyID: string): boolean {
switch(keyID) {
// TODO: consider adding K_ALT, K_CTRL.
// Not currently here as they typically don't show up on mobile layouts.
case 'K_SHIFT':
case 'K_LOPT':
case 'K_ROPT':
Expand Down

0 comments on commit 5abd621

Please sign in to comment.