[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] TOSWIN2 and cursor keys (solved?)




How can this: (code&0xFF00)<=0x20) evaluate to true at any time?

This looks bogus...
It does.
 
code is a signed short.
What is the first wrong thing, it's the scan_code:ascii value pair known from evnt_multi & co.
 
That may correspond to the high bit of the scan code, which means key released... but I'm not sure if this is the case a the GEM level.
Unfortunately, it is not. This is btw the reason why SDL must hook up on IKBD vectors -- there's no way how to determine if a key is pushed/released on OS level.
  
It has to be reverted.
Olivier is still around, so he can perhaps put some light on this. To me the code doesn't make sense at all, even with additional shifts -- comment says it's because of handling NUM + / NUM - but this is not related neither to ASCII 0x20 (0 - 32 are non printable characters, incl. space bar but excluding NUM +/-) nor scancode 0x20 (NUM +/- is 0x4a and 0x4e, respectively), scancodes starting with 0x00 - 0x20 are random keys, mostly lowercase alphabet on US keyboards.

--
MiKRO / Mystic Bytes
http://mikro.atari.org