getkey.py allow for easy viewing of special keys

This commit is contained in:
xfnw 2020-07-24 15:56:26 +00:00
parent 82bbfc0922
commit 222fdb83aa
2 changed files with 14 additions and 0 deletions

13
getkey.py Executable file
View file

@ -0,0 +1,13 @@
#!/usr/bin/env python3
import curses
def main(stdscr):
while True:
k = stdscr.getkey()
print(repr(k))
curses.wrapper(main)

1
nboard
View file

@ -67,6 +67,7 @@ def main(stdscr):
if k in allowedChars: if k in allowedChars:
data[str((ty,tx))] = k data[str((ty,tx))] = k
vx = vx+1 vx = vx+1
time.sleep(0)
with open(dataPath, 'w') as outfile: with open(dataPath, 'w') as outfile:
json.dump(data, outfile) json.dump(data, outfile)
tx = cx + (vx) - width // 2 tx = cx + (vx) - width // 2