Merge pull request #12865 from keymanapp/fix/web/12483-numpad-zoom

fix(web): numpad + and - with zoom shortcut use
This commit is contained in:
Joshua Horton 2025-01-10 08:09:18 +07:00 committed by GitHub
commit e7cc9d345d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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