Re: How to capture return key in an edit control
- Posted by DerekParnell (admin) May 27, 2010
- 1241 views
tmathis said...
I need to capture the return key when entered in a multiedit or richedit control by a user.
Does this help ...
without warning include win32lib.ew constant main=create(Window,"Capture ENTER key",0, 100, 200, 250, 150, 0), in=create(RichEdit,"",main,50,10,150,100,0) procedure esc(integer self, integer event, sequence params) integer keycode keycode=params[1] if keycode=VK_RETURN then setText(in,"<RETURN>") returnValue(-1) -- Make the app ignore this keystroke. end if end procedure setHandler(in,w32HKeyPress,routine_id("esc")) WinMain({main,in},Normal)