Fix sysrq, add backspace, refactor capitals
This commit is contained in:
parent
8a9e4a4464
commit
65678cdc1b
Binary file not shown.
9
input.py
9
input.py
@ -7,9 +7,15 @@ from getch import _Getch
|
||||
get = _Getch();
|
||||
while True:
|
||||
input_key = get()
|
||||
print(input_key)
|
||||
print(input_key + ": " + str(ord(input_key)))
|
||||
if input_key == "?":
|
||||
break
|
||||
if ord(input_key) == 127:
|
||||
write_special("BACKSPACE_DELETE")
|
||||
continue
|
||||
if ord(input_key) == 9:
|
||||
write_special("TAB")
|
||||
continue
|
||||
if ord(input_key) == 27:
|
||||
print("Special key detected!")
|
||||
key = [x for x in "ABCDE7890134~2"]
|
||||
@ -28,6 +34,7 @@ while True:
|
||||
if num == 14:
|
||||
print("pressing prtscr / sysrq")
|
||||
write_special("PRINT_SCREEN")
|
||||
get()
|
||||
continue
|
||||
print("pressing F" + str(num))
|
||||
write_special("F" + str(num))
|
||||
|
12
kb.py
12
kb.py
@ -51,17 +51,27 @@ def write_str(word):
|
||||
if letter == "~":
|
||||
letter = "`"
|
||||
write_caps(keycodes.keycodelst[letter])
|
||||
write_report(NULL_CHAR*8)
|
||||
continue
|
||||
if letter == "_":
|
||||
letter = "-"
|
||||
write_caps(keycodes.keycodelst[letter])
|
||||
write_report(NULL_CHAR*8)
|
||||
continue
|
||||
if letter == "|":
|
||||
letter = "\\"
|
||||
write_caps(keycodes.keycodelst[letter])
|
||||
write_report(NULL_CHAR*8)
|
||||
continue
|
||||
if letter == "!":
|
||||
letter = "1"
|
||||
write_caps(keycodes.keycodelst[letter])
|
||||
write_report(NULL_CHAR*8)
|
||||
continue
|
||||
if letter == "*":
|
||||
letter = "8"
|
||||
write_caps(keycodes.keycodelst[letter])
|
||||
write_report(NULL_CHAR*8)
|
||||
continue
|
||||
if letter.capitalize() == letter and letter >= 'A' and letter <= 'Z':
|
||||
#print(letter.capitalize(), letter)
|
||||
@ -75,7 +85,7 @@ def write_str(word):
|
||||
try:
|
||||
write_char(keycodes.keycodelst[letter])
|
||||
except:
|
||||
print("Unsupported keycode! Ask Cole Deck to add support.")
|
||||
print("Unknown keycode")
|
||||
finally:
|
||||
write_report(NULL_CHAR*8)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user