Re: [WIN] trapping a key press for an SLE

new topic     » goto parent     » topic index » view thread      » older message » newer message

TY,

  Is that in the docs? Why doesn't onKeyDown work? I read somewheres in the docs
that editText won't trap , keyPresses, but WILL trap keyDown events.. is that
true?


Chris


---------- Original Message ----------------------------------
From:         Derek Parnell <dparnell at BIGPOND.NET.AU>
Date:         Sun, 21 Jan 2001 13:22:11 +1100

>----- Original Message -----
>From: "chris bensler" <bensler at Mailops.Com>
>
>> How do I trap a keypress for an SLE? Trying to test for ENTER, but it
>doesn't seem to
>> work..
>
>Here is a sample program for you to use....
>
>  include win32lib.ew
>  without warning
>  constant win = create(Window, "Test", 0, 0, 0, 400, 400, 0),
>           SB  = create(StatusBar, "", win , 0, 0 ,0, 0, 0),
>           sle = create(EditText, "", win, 5, 5, 300, 25, 0)
>
>  procedure xx(integer self, integer event, sequence parms)
>      -- parms[1] is the keycode (13 = Return Key)
>      -- parms[2] is the Shift key status.
>      setText(SB, sprintf("%d %d %d %d", {self, event, parms[1], parms[2]}))
>  end procedure
>  setHandler(sle, w32HKeyPress, routine_id("xx"))
>
>  WinMain(win,0)
>
>------
>Derek Parnell
>Melbourne, Australia
>(Vote [1] The Cheshire Cat for Internet Mascot)
>


________________________________________________________________

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu