From 7b269bb0113392891ec58833d9d4c1688c0a07c7 Mon Sep 17 00:00:00 2001 From: hwf1324 <1398969445@qq.com> Date: Wed, 15 Nov 2023 22:16:57 +0800 Subject: [PATCH] Add a double-click event to the event list to display the event description. --- addon/globalPlugins/evtTracker.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addon/globalPlugins/evtTracker.py b/addon/globalPlugins/evtTracker.py index 0995925..2a5bf93 100644 --- a/addon/globalPlugins/evtTracker.py +++ b/addon/globalPlugins/evtTracker.py @@ -16,6 +16,7 @@ import NVDAObjects from scriptHandler import script import wx +import ui # Security: disable the global plugin altogether in secure mode. @@ -242,6 +243,7 @@ def __init__(self, eventHistory): style=wx.LB_SINGLE ) self.list.Bind(wx.EVT_LISTBOX, self.onListItemSelected) + self.list.Bind(wx.EVT_LISTBOX_DCLICK, self.onListItemDClick) contentsSizer.Add(self.list, flag=wx.EXPAND) contentsSizer.AddSpacer(gui.guiHelper.SPACE_BETWEEN_VERTICAL_DIALOG_ITEMS) self.description = gui.guiHelper.LabeledControlHelper( @@ -273,3 +275,9 @@ def onListItemSelected(self, event): nvdaEvent = self.eventHistory[index] if index >= 0 else None if nvdaEvent: self.description.control.Value = "\n".join(nvdaEvent.info) + + def onListItemDClick(self, event): + index = event.GetSelection() + nvdaEvent = self.eventHistory[index] if index >= 0 else None + if nvdaEvent: + ui.browseableMessage("\n".join(nvdaEvent.info), nvdaEvent.type)