[Tutor] key detection

Jim Mooney Py3.4.3winXP cybervigilante at gmail.com
Thu May 7 00:24:20 CEST 2015


On 6 May 2015 at 14:08, Dave Angel <davea at davea.name> wrote:

> I don't know why you would be expecting to get a utf-8 character for the
> second byte of a function key code.  It's an entirely arbitrary byte
> sequence, and not equivalent to anything in Unicode, encoded or not


I just didn't think of accounting for function keys until I hit one -
experimental learning. The program I'm working on doesn't require F keys,
but I tried one just to see what would happen ;')  It's worth making the
error to reinforce unicode in my head. One item - once I dropped decoding
for special keys, some were printed as hex codes but some as letters. i.e.
F11 was b'\x85', but F9 and F10 were b'C' and b'D', so I assume the second
byte of some function keys just happens to map to utf-8 letters. Sure
enough, when I put in decoding again, F9 and F10 second bytes printed as C
and D, but the program bailed on F11.



-- 
Jim

"What a rotten, failed experiment. I'll start over. Maybe dogs instead of
monkeys this time." --God


More information about the Tutor mailing list