1. [WIN] trapping a key press for an SLE
- Posted by chris bensler <bensler at Mailops.Com> Jan 20, 2001
- 623 views
- Last edited Jan 21, 2001
How do I trap a keypress for an SLE? Trying to test for ENTER, but it doesn't seem to work.. Chris ________________________________________________________________
2. Re: [WIN] trapping a key press for an SLE
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Jan 21, 2001
- 588 views
----- 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)
3. Re: [WIN] trapping a key press for an SLE
- Posted by chris bensler <bensler at Mailops.Com> Jan 20, 2001
- 585 views
- Last edited Jan 21, 2001
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) > ________________________________________________________________
4. Re: [WIN] trapping a key press for an SLE
- Posted by Al Getz <xaxo at AOL.COM> Jan 21, 2001
- 583 views
If you intend to trap all keystrokes, i think you'll have to subclass the edit control. You can pass events you dont want to trap, while processing whatever you wish. Good luck with it, Al