I have scoured high and low for this information, so I'm guessing what I'm about to ask can't currently be done in WXPython. In straight Win32, one can create an input field for capturing hotkeys with the WM_HOTKEY class. I am wanting to give the users of our app an easy way to customize some global commands, but I'm not finding a WX analog. If the Win32 way is the only way to go, is it possible to create a form in Win32 and embed it inside a WXPython container?
Are you talking about hotkeys inside your wxPython application or are you trying to bind keys to the OS level? If it’s just for your program, look into the AcceleratorTable:
Thanks, Mike. My goal is to implement system-wide hotkeys in the app itself. Hard-wiring them is very straight-forward, but I also want to give our users the ability to change the commands if they want to. The control I am wanting to add in my app is the hotkey edit field (which you can find in the Shortcut tab of a Windows Desktop icon). Again, this is relatively easy in straight Win32, but I am coming to the realization that WX may be defficient here.
Steve
···
–
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
Are you talking about hotkeys inside your wxPython application or are you trying to bind keys to the OS level? If it’s just for your program, look into the AcceleratorTable:
Thanks, Mike. My goal is to implement system-wide hotkeys in the app itself. Hard-wiring them is very straight-forward, but I also want to give our users the ability to change the commands if they want to. The control I am wanting to add in my app is the hotkey edit field (which you can find in the Shortcut tab of a Windows Desktop icon). Again, this is relatively easy in straight Win32, but I am coming to the realization that WX may be defficient here.
I have scoured high and low for this information, so I'm guessing what
I'm about to ask can't currently be done in WXPython. In straight Win32,
one can create an input field for capturing hotkeys with the WM_HOTKEY
class. I am wanting to give the users of our app an easy way to
customize some global commands, but I'm not finding a WX analog.
There isn't one, but I expect that it would not be too terribly hard to do, as Mike suggested, by catching the key down and up events and modifying the content of a read-only text ctrl to match the key states.
If the
Win32 way is the only way to go, is it possible to create a form in
Win32 and embed it inside a WXPython container?
Yes. You can get the Windows Handle for any window/widget (such as a wx.Panel) with GetHandle, and create your widget using native win32 API calls using that handle as the parent. There is also an example in the wiki of how to intercept the WndProc messages from a wx window if you need to do something like that.