Polling/probing the keyboard?

Richmond richmondmathewson at gmail.com
Mon Dec 23 15:33:29 EST 2013

On 23/12/13 22:22, Richmond wrote:
> On 23/12/13 22:04, Geoff Canyon wrote:
>> On Fri, Dec 20, 2013 at 9:49 AM, Richmond 
>> <richmondmathewson at gmail.com>wrote:
>>> send "mouseUp" to btn "BTTN"
>>> but I cannot do this:
>>> send "keyDown" to key 112
>>> where 112 is the rawKeyDown value of that key on my keyboard.
>> In both cases (unless there's something really unusual about what you're
>> doing) it would be better to define a separate handler to do 
>> <whatever> and
>> then call that handler from within the mouseUp or rawKeyDown, so that 
>> when
>> you want that thing to happen *apart* from those instances, you can just
>> call the handler.
>> _______________________________________________
> My problem is that I have a range of programs that allow end-users to 
> type material in
> dead or rather unusual writing systems, using a "normal" keyboard.
> Now on my UK English keyboard I happen to be using at the moment where I,
> having been using US English keyboards for the last 20 years, expect 
> to see a '@'
> there is a double-quote mark.
> I want to be able to signal to end-users which key they should press 
> on their keyboards
> to send a mouseUp to one of my virtual keys. Now what has a 'w' on my 
> keyboard may,
> for the sake of argument have a 'у' on Professor Malenkov's keyboard 
> and 'в' on
> Professor Ustinov's keyboard; so putting a 'w' into a "window" on my 
> interface is not going to help
> either of those imaginary professors at all.
> So I need to get the keyDown char that a rawKeyDown of 119 will 
> generate on whosoever's
> computer my program is running on.
> I can, however, do this sort of thing:
> on rawKeyDown RKD
> put RKD into fld "rkd"
> end rawKeyDown
> on keyUp KD
> put KD into fld "kd"
> put fld "rkd" & " = " & fld "kd" into fld "equiv"
> end keyUp
> which I just worked out while answering your message, and feel "fairly 
> bl**dy stupid" that is took
> me so long to work that one out!
> Anyway, thousands of thanks for your posting as it kicked my lazy 
> brain into doing something vaguely constructive at last.
> Richmond.

The main snag about this is that if one has a rawKeyUp routine in, say, 
one's cardScript, it will block
a keyUp routine.

I would like to have a cardScript that contains rawKeyDown, keyDown and 
rawKeyUp, and, just now
cannot quite see my way round that.

More information about the Use-livecode mailing list