From 7d6e230fd97650029fb59f7930060f4d667830e6 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Fri, 7 May 2021 16:52:10 -0500 Subject: [PATCH] Fix issue that avoids TWBlue to use Shift+F10 as menu key. Fixes #353 --- doc/changelog.md | 1 + src/controller/buffers/baseBuffers.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/doc/changelog.md b/doc/changelog.md index bb2ad5eb..7effe95a 100644 --- a/doc/changelog.md +++ b/doc/changelog.md @@ -2,6 +2,7 @@ ## changes in this version +* TWBlue will take Shift+F10 again as the contextual menu key in the list of items in a buffer. This stopped working after we have migrated to WX 4.1. ([#353,](https://github.com/manuelcortez/TWBlue/issues/353)) * TWBlue should render correctly retweets of quoted tweets. ([#365,](https://github.com/manuelcortez/TWBlue/issues/365)) * Fixed an error that was causing TWBlue to be unable to output to screen readers at times. ([#369,](https://github.com/manuelcortez/TWBlue/issues/369)) * Fixed autocomplete users feature. ([#367,](https://github.com/manuelcortez/TWBlue/issues/367)) diff --git a/src/controller/buffers/baseBuffers.py b/src/controller/buffers/baseBuffers.py index 728a5e62..2bb09c80 100644 --- a/src/controller/buffers/baseBuffers.py +++ b/src/controller/buffers/baseBuffers.py @@ -59,15 +59,21 @@ class buffer(object): elif ev.GetKeyCode() == wx.WXK_F6: event = "volume_up" elif ev.GetKeyCode() == wx.WXK_DELETE and ev.ShiftDown(): event = "clear_list" elif ev.GetKeyCode() == wx.WXK_DELETE: event = "destroy_status" + # Raise a Special event when pressed Shift+F10 because Wx==4.1.x does not seems to trigger this by itself. + # See https://github.com/manuelcortez/TWBlue/issues/353 + elif ev.GetKeyCode() == wx.WXK_F10 and ev.ShiftDown(): event = "show_menu" else: event = None ev.Skip() if event != None: try: + ### ToDo: Remove after WX fixes issue #353 in the widgets. + if event == "show_menu": + return self.show_menu(widgetUtils.MENU, pos=self.buffer.list.list.GetPosition()) getattr(self, event)() except AttributeError: pass - + def volume_down(self): """ Decreases volume by 5%""" if self.session.settings["sound"]["volume"] > 0.0: