tweaks
This commit is contained in:
parent
abf14d4f97
commit
c187834244
32
input.py
32
input.py
@ -18,6 +18,10 @@ while True:
|
||||
print(input_key + ": " + str(ord(input_key)))
|
||||
#if input_key == "?":
|
||||
# break
|
||||
if ord(input_key) == 13:
|
||||
write_special("ENTER")
|
||||
clear()
|
||||
continue
|
||||
if ord(input_key) > 0 and ord(input_key) <= 26: # ctrl + alpha
|
||||
idx = ord(input_key) - 1
|
||||
letter = alpha[idx]
|
||||
@ -26,10 +30,6 @@ while True:
|
||||
write_ctrl(letter)
|
||||
clear()
|
||||
continue
|
||||
if ord(input_key) == 13:
|
||||
write_special("ENTER")
|
||||
clear()
|
||||
continue
|
||||
if ord(input_key) == 127:
|
||||
write_special("BACKSPACE_DELETE")
|
||||
clear()
|
||||
@ -40,22 +40,14 @@ while True:
|
||||
continue
|
||||
if ord(input_key) == 27:
|
||||
print("Special key detected!")
|
||||
#key = [x for x in "ABCDE7890134~2"]
|
||||
input_key = get()
|
||||
print(input_key)
|
||||
#if ord(input_key) == 91:
|
||||
# input_key = get()
|
||||
# #arrowkey = [x for x in "ABCD"]
|
||||
# #arrowout = ["UP_ARROW", "DOWN_ARROW", "RIGHT_ARROW", "LEFT_ARROW"]
|
||||
# write_special(arrowout[arrowkey.index(input_key)])
|
||||
# print("pressing " + arrowout[arrowkey.index(input_key)])
|
||||
# continue
|
||||
#print(input_key)
|
||||
if ord(input_key) == 27:
|
||||
break
|
||||
if input_key == "[":
|
||||
again = False
|
||||
input_key = get()
|
||||
print(input_key)
|
||||
#print(input_key)
|
||||
if input_key != "[":
|
||||
if input_key in arrowkey:
|
||||
write_special(arrowout[arrowkey.index(input_key)])
|
||||
@ -65,7 +57,7 @@ while True:
|
||||
else:
|
||||
again = True
|
||||
input_key = get()
|
||||
print(input_key)
|
||||
#print(input_key)
|
||||
num = key.index(input_key) + 1
|
||||
if num == 13: # del
|
||||
print("pressing DEL")
|
||||
@ -83,14 +75,4 @@ while True:
|
||||
clear()
|
||||
if again:
|
||||
get()
|
||||
#if int(input_key) > 0 and int(input_key) <= 9:
|
||||
# write_special("F" + input_key)
|
||||
#if input_key == "0":
|
||||
# write_special("F10")
|
||||
#if input_key == "-":
|
||||
# write_special("F11")
|
||||
#if input_key == "=":
|
||||
# write_special("F12")
|
||||
#if ord(input_key) == 27:
|
||||
# break
|
||||
write_str(input_key)
|
||||
|
Loading…
x
Reference in New Issue
Block a user