I'm using the getch code from this stack overflow question, and I've written the following script:
getch = _Getch()
while(1):
test = getch()
if test == 'm':
break
else:
print ord(test)
as you can see, it prints the ascii value of each input. So a sample output looks like this, where >>> represents my input:
>>>a
97
>>>ctrl-c
3
>>>Esc
27
So far so good, but when I press an arrow key, it gives me:
>>>(Left arrow)
27
91
66
>>>(right arrow)
27
91
67
So I can see that 27 is the escape char, but what is 91? 66 and 67 must be sub values of this.
I'm looking for the values so that I can implement them to use the arrows to move a cursor. How would I use this in an if charvalue == scenario?