Skip to content

Commit

Permalink
Merge pull request #12865 from keymanapp/fix/web/12483-numpad-zoom
Browse files Browse the repository at this point in the history
fix(web): numpad + and - with zoom shortcut use
  • Loading branch information
jahorton authored Jan 10, 2025
2 parents fbb7bcb + 2bd183c commit e7cc9d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions web/src/engine/keyboard/src/defaultRules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ export default class DefaultRules {

// Should not be used for mnenomic keyboards. forAny()'s use of this method checks first.
public forNumpadKeys(Lkc: KeyEvent) {
// Do not provide output if modifiers other than Shift are held.
// There may be associated shortcuts we might otherwise block.
// See #12483 - zooming shortcuts can trigger from CTRL & + or - on the numpad
if(Lkc.Lmodifiers != ModifierKeyConstants.K_SHIFTFLAG && Lkc.Lmodifiers != 0) {
return null;
}

// Translate numpad keystrokes into their non-numpad equivalents
if(Lkc.Lcode >= Codes.keyCodes["K_NP0"] && Lkc.Lcode <= Codes.keyCodes["K_NPSLASH"]) {
// Number pad, numlock on
Expand Down

0 comments on commit e7cc9d3

Please sign in to comment.