Allow compile to be triggered with Ctrl/Cmd-s when Caps Lock is enabled (#14547)

GitOrigin-RevId: f78bd433e6862a49f353e3f994c90024a06e2b3f
This commit is contained in:
Alf Eaton 2023-09-01 12:04:32 +01:00 committed by Copybot
parent 5aeb461551
commit e320473d05

View file

@ -12,11 +12,21 @@ export const startCompileKeypress = event => {
if (event.key === 's' || event.key === 'Enter' || event.key === '.') { if (event.key === 's' || event.key === 'Enter' || event.key === '.') {
return true return true
} }
// Ctrl+s with Caps-Lock on
if (event.key === 'S' && !event.shiftKey) {
return true
}
} else if (event.metaKey) { } else if (event.metaKey) {
// Cmd+s / Cmd+Enter // Cmd+s / Cmd+Enter
if (event.key === 's' || event.key === 'Enter') { if (event.key === 's' || event.key === 'Enter') {
return true return true
} }
// Cmd+s with Caps-Lock on
if (event.key === 'S' && !event.shiftKey) {
return true
}
} }
} }