Polyglot keyDowns

Richmond richmondmathewson at gmail.com
Sun Dec 15 11:39:47 EST 2013


I'm having a lot of fun with this one.

Imagine a virtual keyboard if you will; perhaps a bit like those on iPads.

Now imagine that as I mouseEnter the button on the virtual keypad that 
would correspond to the 'P' key
on an American English physical keyboard, but the 'П' key on a Bulgarian 
keyboards, and all sorts of other
symbols on other physical keyboards.

a lowercase 'p' in both ASCII and Unicode is char 112, so it is dead 
easy to have this sort of script in one's
button on one's virtual keyboard:

on mouseEnter
set the useUnicode to true
set the unicodeText of fld "Wozzit" to numToChar(112)
end mouseEnter

so that when the end-user does a mouseEnter over the button its keyboard 
equivalent appears in a
display field called "Wozzit".

All fine and dandy, but come the chap who has an Armenian keyboard he 
really wants to know that
the key is the 'պ' as he doesn't have a 'p' key.

So I started imagining I could do this sort of thing:\

get the keyDown for rawKeyDown 112

but I cannot.

I could have a preference script at the start of my program where the 
end-user could set his/her keyboard layout; but that presupposes I know 
all the potential keyboard layouts of my end-users, and am prepared to
spend the next 3 months setting up all the variants . . .

Richmond.





More information about the Use-livecode mailing list