I have an app I wrote in Python/wxPython. When I click a button, the action that is taken will depend on whether or not a modifier key (such as CTRL) is currently pressed. I can't toggle a swich based on a keypress event (eg ctrldown = True or False) because the form may not have focus continuously. Ideally, the button click code should be something like
if ctrldown:
#ctrl key is pressed - do one action
else:
#ctlr key is not pressed - do something else
Is there any way of checking the current status of the keys like CTRL, SHIFT, ALT, etc?