Is there a mapping table for all rawKeyUp Codes? No solution yet with LC 8

Paul Hibbert paul at livecode.org
Mon Dec 5 20:44:06 CET 2016


On Mac OS Sierra 10.12.1 with LC 8.1.2(rc2) and German Keyboard layout I see:

Shift + dot (":") the keyname = 58
Shift + ö ("Ö") the keyname = 58

But if you add to these 'the keysDown' as Herman suggested I see:

Shift + dot (":") the keyname = 58 and the keysDown = 46,65505 (46 is the : key and 65505 is the shift key)
Shift + ö ("Ö") the keyname = 58 and the keysDown = 59,65505 (59 is the ö key and 65505 is the shift key)

So you should be able to use the first item of the keysDown to differentiate which key was pressed. Maybe not ideal, but it should work.

e.g.
   put keyname and item 1 of the keysDown

Paul

> On Dec 5, 2016, at 8:18 AM, Tiemo Hollmann TB <toolbook at kestner.de> wrote:
> 
> Hallo Hermann,
> 
> shift + ö and shift + dot both return 58, anyhow if I give the output tot he message box or a field. I can't see a script error. For me it's an engine error.
> 
> Same with "-" and "ß", both return 45.
> I don't see a chance on how I could differentiate between "-" and "ß", when getting 45.
> 
> Perhaps I didn't understood, what you meant to workaround this issue.
> 
> Tiemo
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] Im Auftrag von hh
> Gesendet: Montag, 5. Dezember 2016 14:55
> An: use-livecode at lists.runrev.com
> Betreff: Re: AW: Is there a mapping table for all rawKeyUp Codes? No solution yet with LC 8
> 
> 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_) and NOT 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*
>> 
>> e.g.
>> 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
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



More information about the use-livecode mailing list