wxPython
Hotkeys
# Hotkey: CTRL + SHIFT + F12
self.RegisterHotKey(1001, win32con.MOD_CONTROL|win32con.MOD_SHIFT, win32con.VK_F12)
self.Bind(wx.EVT_HOTKEY, self.on_hotkey, id=1001)
# Hotkey: CTRL + ALT + P
self.RegisterHotKey(1002, win32con.MOD_CONTROL|win32con.MOD_ALT, ord('P'))
self.Bind(wx.EVT_HOTKEY, self.on_hotkey, id=1002)
# Key state
print wx.GetKeyState(ord('h')) # Prints true if the 'h' key is currently pressed