Created
April 2, 2018 12:07
-
-
Save LandonPowell/f07b64fba96db91c8036d464189d14ad to your computer and use it in GitHub Desktop.
Never take your tippy typers off the home row again! ASDFJKL; are now mod keys! Hold 'em down then press spacebar.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 8 mod keys and one real key. | |
# Minimalist typing scheme. | |
# Never move your hands off the home row. | |
# Requires https://pypi.python.org/pypi/keyboard/ | |
# EXAMPLE : | |
# For the letter 'A', the binary is 0100 0001 | |
# Hold down 's' and semicolon, and then press Space. | |
import keyboard | |
keysdown = { | |
'a' : False, | |
's' : False, | |
'd' : False, | |
'f' : False, | |
'j' : False, | |
'k' : False, | |
'l' : False, | |
';' : False, | |
} | |
def currentEntry(): | |
n = 0 | |
for i, x in enumerate(";lkjfdsa"): | |
if keysdown[x]: | |
n += 2**i | |
return chr(n) | |
def keyInput(event): | |
if event.name in "asdfjkl;": | |
keysdown[event.name] = event.event_type == "down" | |
elif event.event_type == "down" and event.name == "space": | |
keyboard.write(currentEntry()) | |
keyboard.hook(keyInput, True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use Python 3.7 by the way.