AW: Is there a mapping table for all rawKeyUp Codes? No solution yet with LC 8
hh at hyperhh.de
Mon Dec 5 14:55:15 CET 2016
The '58-example' is obviously a script error:
the message box has always display bugs, you may better use a field
for the display.
If I understand right, then you want now
the keyCode (an event, depending on _hardware_)
the characterCode (a number representation of the char).
Some Mac apps show, with an abuse of the name, the characterCode and
not the hardware keycode.
On a german keyboard from Apple the keycodes are
on MacOS 10.12.1/LC 9.0.0-dp2 (65505=shift)
ö = 59
Ö = 59,65505
. = 46
: = 46,65505
This is not contradicting your results if your hardware is different.
You could think about using ___the keysdown___, for example this works
for me, using a locked field 1 and the following card script (just to
see the difference):
on idle ; put the keysDown into fld 1 ; end idle
p.s. For the LC table (Mark's link) you could use:
put baseConvert(hexValue,16,10) into decValue
> Since the keyup handler is broken, I am still trying to build a table for mapping the rawkeyup key to a char. When testing a prototype it seemed to be easy, but now there are some pitfalls I don't get over. On Mac OS X 10.11, German system, German keyboard I get with some different char the same keyname.
> When putting the following code into a field:
> *On rawkeyup keyname*
> *put keyname*
> *end rawkeyup*
> Entering shift + dot (":") I get the keyname: 58
> Entering shift + ö ("Ö") I also get the keyname: 58
> ... and others...
> How can I map these keynames back to the char?
> Anttis kecode app shows for the first example the keycode 47 and for the second example 41. But that’s not what I get from rawkeyup.
> And with Marks link to the source code I couldn't find a solution either. Because there is only a hex value table included.
> Can anybody confirm these doubled codes from rawkeyup (with a German keyboard)?
> I am stuck with LiveCode 8
> Thanks for any ideas
More information about the use-livecode