Viewer: Fix ctrl+m shortcut not working on windows

This commit is contained in:
Kovid Goyal 2019-10-08 18:08:51 +05:30
parent 88ed3546be
commit 5385df337e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -51,8 +51,12 @@ def get_key_text(evt):
cc = key.charCodeAt(0)
# on windows in webengine pressing ctrl+ascii char gives us an ascii
# control code
if 0 < cc < 32 and evt.ctrlKey and not evt.metaKey and not evt.shiftKey and not evt.altKey:
key = chr(96 + cc)
if (0 < cc < 32 or key is 'Enter') and evt.ctrlKey and not evt.metaKey and not evt.shiftKey and not evt.altKey:
if key is 'Enter':
if evt.code and evt.code is not 'Enter':
key = 'm'
else:
key = chr(96 + cc)
return key