Skip to content

Instantly share code, notes, and snippets.

@LandonPowell
Created April 2, 2018 12:07
Show Gist options
  • Save LandonPowell/f07b64fba96db91c8036d464189d14ad to your computer and use it in GitHub Desktop.
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.
# 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)
@LandonPowell
Copy link
Author

Use Python 3.7 by the way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment