diff --git a/chirp/wxui/common.py b/chirp/wxui/common.py index c906a2e2..3603b290 100644 --- a/chirp/wxui/common.py +++ b/chirp/wxui/common.py @@ -371,6 +371,14 @@ def __init__(self, settinggroup, *a, **k): self.pg.Bind(wx.propgrid.EVT_PG_CHANGED, self._pg_changed) self.pg.Bind(wx.EVT_MOTION, self._mouseover) + self.pg.DedicateKey(wx.WXK_TAB) + self.pg.DedicateKey(wx.WXK_RETURN) + self.pg.DedicateKey(wx.WXK_UP) + self.pg.DedicateKey(wx.WXK_DOWN) + self.pg.AddActionTrigger(wx.propgrid.PG_ACTION_EDIT, wx.WXK_RETURN) + self.pg.AddActionTrigger(wx.propgrid.PG_ACTION_NEXT_PROPERTY, + wx.WXK_RETURN) + sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(sizer) sizer.Add(self.pg, 1, wx.EXPAND) diff --git a/chirp/wxui/memedit.py b/chirp/wxui/memedit.py index 4f9c1332..49fbb1b8 100644 --- a/chirp/wxui/memedit.py +++ b/chirp/wxui/memedit.py @@ -2411,6 +2411,14 @@ def __init__(self, memedit, memories, *a, **k): self._pg = wx.propgrid.PropertyGrid(self._tabs, style=wx.propgrid.PG_BOLD_MODIFIED) self._pg.Bind(wx.propgrid.EVT_PG_CHANGED, self._mem_prop_changed) + + self._pg.DedicateKey(wx.WXK_RETURN) + self._pg.DedicateKey(wx.WXK_UP) + self._pg.DedicateKey(wx.WXK_DOWN) + self._pg.AddActionTrigger(wx.propgrid.PG_ACTION_EDIT, wx.WXK_RETURN) + self._pg.AddActionTrigger(wx.propgrid.PG_ACTION_NEXT_PROPERTY, + wx.WXK_RETURN) + self._tabs.InsertPage(0, self._pg, _('Values')) page_index = 0 self._extra_page = None diff --git a/chirp/wxui/settingsedit.py b/chirp/wxui/settingsedit.py index 1b4fbe64..12432b9f 100644 --- a/chirp/wxui/settingsedit.py +++ b/chirp/wxui/settingsedit.py @@ -38,10 +38,17 @@ def __init__(self, radio, *a, **k): self._group_control = wx.Treebook(self, style=wx.LB_LEFT) self._group_control.GetTreeCtrl().SetMinSize((250, -1)) sizer.Add(self._group_control, 1, wx.EXPAND) + self._group_control.GetTreeCtrl().Bind(wx.EVT_KEY_DOWN, + self._key) self._initialized = False self._restore_selection = None + def _key(self, event): + if event.GetKeyCode() in (wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER): + self._group_control.GetCurrentPage().SetFocus() + event.Skip() + def _initialize(self, job): self.stop_wait_dialog() with common.error_proof(Exception): @@ -53,6 +60,10 @@ def _initialize(self, job): self._group_control.SetSelection(self._restore_selection) self._restore_selection = None + # Focus the selector after it loads + tc = self._group_control.GetTreeCtrl() + wx.CallAfter(tc.SetFocus) + def selected(self): if not self._initialized: self._initialized = True