Skip to content

Instantly share code, notes, and snippets.

View m10x's full-sized avatar
💻

Maximilian Hildebrand m10x

💻
View GitHub Profile
@m10x
m10x / globalhotkeys.py
Last active July 5, 2023 10:43 — forked from mdavey/globalhotkeys.py
Global hot keys in Python for Win32, fixed range and missing brackets, implemented that you can now reassign a key without error, works now perfectly with Python 3.X. Added method to unregister. Accomplished PEP 8 compliance.
from ctypes import windll
from ctypes import byref as ctypes_byref
from ctypes.wintypes import MSG as wintypes_MSG
import win32con
class GlobalHotKeys(object):
key_mapping = []
user32 = windll.user32