Skip to content

Commit

Permalink
ENH: PedalConnector code clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Rakhesis committed Jun 10, 2024
1 parent 1f96fd7 commit ed080de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion invesalius/net/pedal_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, neuronavigation_api=None, window=None):

if const.KEYSTROKE_PEDAL_ENABLED:
self._set_frame(window)
self.panel_callbacks = {}
self.panel_callbacks = {} # dict[wxpanel_id, dict[callback_name, function]]

def _set_frame(self, panel):
try:
Expand All @@ -70,6 +70,7 @@ def OnKeyPress(evt, state):
if remove_when_released:
self.panel_callbacks[panel_id].pop(name)
evt.Skip()

panel.Bind(wx.EVT_CHAR_HOOK, partial(OnKeyPress, state=True))

def add_callback(self, name, callback, remove_when_released=False, panel=None):
Expand Down

0 comments on commit ed080de

Please sign in to comment.