Skip to content

Instantly share code, notes, and snippets.

View yportne8's full-sized avatar
🏠
Working from home

ChongSoo Kim yportne8

🏠
Working from home
View GitHub Profile
@yportne8
yportne8 / directkeys.py
Last active June 23, 2022 15:15 — forked from Aniruddha-Tapas/directkeys.py
Script to emulate key-presses on Windows via Python.
# directkeys.py
# http://stackoverflow.com/questions/13564851/generate-keyboard-events
# msdn.microsoft.com/en-us/library/dd375731
import ctypes
from ctypes import wintypes
import time
user32 = ctypes.WinDLL('user32', use_last_error=True)