Polling/probing the keyboard?
Richmond
richmondmathewson at gmail.com
Mon Dec 23 15:56:29 EST 2013
On 23/12/13 22:50, Jan Schenkel wrote:
> You need to 'pass' the rawKeyDown, rawKeyUp and keyDown messages or LiveCode will stop processing the key event.
> This allows you to discard illegal characters. Try the following:
>
> on rawKeyDown RKD
> put RKD into fld "rkd"
> pass rawKeyDown
> end rawKeyDown
>
> on keyUp KD
> put KD into fld "kd"
> put fld "rkd" & " = " & fld "kd" into fld "equiv"
> end keyUp
>
> HTH,
>
> Jan Schenkel.
Thank you very much; that does allow me to trap both rawKeyDown
and rawKeyUp for US English; but still mucks up badly on other keyboard
layouts.
Richmond.
>
> =====
> Quartam Reports & PDF Library for LiveCode
> www.quartam.com
>
> =====
> "As we grow older, we grow both wiser and more foolish at the same time." (La Rochefoucauld)
>
> --------------------------------------------
> On Mon, 12/23/13, Richmond <richmondmathewson at gmail.com> wrote:
>
> Subject: Re: Polling/probing the keyboard?
> To: "How to use LiveCode" <use-livecode at lists.runrev.com>
> Date: Monday, December 23, 2013, 12:33 PM
>
> 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.
>
> _______________________________________________
> 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