From 5385df337eabe222bba33c028eea97cd3256df27 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 8 Oct 2019 18:08:51 +0530 Subject: [PATCH] Viewer: Fix ctrl+m shortcut not working on windows --- src/pyj/read_book/shortcuts.pyj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pyj/read_book/shortcuts.pyj b/src/pyj/read_book/shortcuts.pyj index 157ec145f4..2b186d19bd 100644 --- a/src/pyj/read_book/shortcuts.pyj +++ b/src/pyj/read_book/shortcuts.pyj @@ -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