Closed suresttexas00 closed 7 years ago
When I enable the the print statement in readchar_linux.py; I get this for Delete:
('\x1b', '0x1b')
('[', '0x5b')
('3', '0x33')
('~', '0x7e')
I get this for Backspace:
('\x7f', '0x7f')
Since delete key and backspace keys do different things, they cannot be the same code.
I don't have a key labeled "SUPR", so I don't know what it is.
I created this little interactive tester for use in reading what keys produce:
# -*- coding: utf-8 -*-
import readchar
while True:
x = readchar.readkey()
if x == readchar.key.F5:
print("terminated.")
break
print("key read len was: %s" % len(x))
if x == readchar.key.INSERT:
print(" key")
I also removed the Danny Yoo attribution in the Key.py file.
This is correct because on English keyboards there is no such key as SUPR ... our keyboards it is DELETE and is not the same as Backspace... https://www.pcreview.co.uk/threads/spanish-keyboard.2840896/
One of my keyboards:
asdfgj<-backspace deletes these
\<cursor> Delete deletes these->
klzxcvbnm
My only concern in all this is does it still work in windows. Does the travis test for windows?
I am going to close this and do a re-pull for clarity. I have a new solution that also works for all Linux keys, including the pesky ESC key. I also implements a version of @guiweber windows code, although it tries to use the Linux type constants in our key.py file versus the string Windows names.
Per my other message, https://github.com/magmax/python-readchar/issues/20#issuecomment-286588396
1 way was the best I can manage for now!
This works (but I am not sure I need to have the `\x4f\ now since that is not actually part of the F key codes. (at least not on linux?)
EDIT: removed the
\x4f\
checking too.. 2ND EDIT: re-added the\x4f\
for F1-F4.