Don't mutate the accelerator character wuth the shift key if it's a number

This commit is contained in:
Samuel Attard 2017-06-13 20:29:54 +10:00
parent 014aaccfc6
commit 29dbb93f16

View file

@ -26,8 +26,14 @@ void SetPlatformAccelerator(ui::Accelerator* accelerator) {
&characterIgnoringModifiers); &characterIgnoringModifiers);
if (character != characterIgnoringModifiers) { if (character != characterIgnoringModifiers) {
// 48 === '0', 57 === '9'
if (characterIgnoringModifiers >= 48 && characterIgnoringModifiers <= 57) {
// The character is a number so lets not mutate it with the modifiers
character = characterIgnoringModifiers;
} else {
modifiers ^= NSShiftKeyMask; modifiers ^= NSShiftKeyMask;
} }
}
if (character == NSDeleteFunctionKey) { if (character == NSDeleteFunctionKey) {
character = NSDeleteCharacter; character = NSDeleteCharacter;