From: Alan Chen Date: 2002-11-14T08:41:36+09:00 Subject: Re: VRuby question: detecting tab or return in VREdit On Thu, Nov 14, 2002 at 08:00:25AM +0900, Armin Roehrl wrote: > Hi, > > I have a VREdit input field. > I enter text and then press tab or return > and I only get a beep and the _changed method > does not get called. How can I detect tab or return > keyboard input? > > There must be a tiny little detail I do not > know about how to change the properties of > that VREdit input field, no? > > My feeling is that I can add it the "style", but WS_TABSTOP > does not do the trick. Who knows the "magic" entry I need? > Probably dead-standard for anybody who knows the Windows > GUI API. > > addControl(VREdit, "name","",1.5,0.5,3,0.65, WStyle::WS_TABSTOP) > > Why I want that? > To enable the input focus jump by pressing > Tab from one VREdit field to the next. This is an ugly hack, but I just trapped WM_KEYUP events like so... class MyVREdit < VREdit def vrinit super() addHandler WMsg::WM_KEYUP, 'keyup', MSGTYPE::ARGINTINT,nil acceptEvents [WMsg::WM_KEYUP] end def self_keyup(keyc, keyd) # look for TAB or enter keycodes # used a callback to initiate next_field logic end end -- Alan Chen Digikata LLC http://digikata.com