Re: How to capture return key in an edit control

new topic     » goto parent     » topic index » view thread      » older message » newer message
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) 
 
new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu