From b1ef8dc2fb2e05534d92e4402fb83c8248a572f4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 7 Oct 2019 16:16:23 +0530 Subject: [PATCH] Right clicking in overlays should act like Esc --- src/pyj/read_book/overlay.pyj | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/pyj/read_book/overlay.pyj b/src/pyj/read_book/overlay.pyj index 8c6dafeddb..d2c6debe21 100644 --- a/src/pyj/read_book/overlay.pyj +++ b/src/pyj/read_book/overlay.pyj @@ -471,8 +471,13 @@ class Overlay: self.view = view c = self.clear_container() c.addEventListener('click', self.container_clicked) + c.addEventListener('contextmenu', self.oncontextmenu, {'passive': False}) self.panels = [] + def oncontextmenu(self, evt): + evt.preventDefault() + self.handle_escape() + def clear_container(self): c = self.container clear(c)