Re: [WIN] trapping a key press for an SLE
- Posted by Derek Parnell <dparnell at BIGPOND.NET.AU> Jan 21, 2001
- 495 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)