Re: Win32Lib Losing Keys
- Posted by Derek Parnell <ddparnell at bigpond.com> Jul 08, 2004
- 453 views
cklester wrote: > > Derek Parnell wrote: > > > > > > > How do I prevent the spacebar from clicking the button? > > > > > > > You can put this patch into win32lib... > > What if I have multiple buttons/controls? Do I need to define > a KeyDown routine for each and every control that could possibly > be affected by a spacebar? Look, I don't know what your application is supposed to do here, so I'm guessing and reacting to your specific questions. You only asked about ignoring the spacebar for ONE button. Anyhow... It all depends! Do you have ANY controls that you want the spacebar to work in? If so, the the answer to your latest question is YES. This is not so big a deal to do though. For example... sequence SkipBars SkipBars = { Btn1, Btn3, Btn15, Fld2, Checkbox44, ... you get the idea...} procedure Skip_the_spacebar(integer self, integer event, sequence parms) if parms[1] = ' ' then returnValue(-1) end if end procedure setHandler(SkipBars, w32HKeyDown, routine_id("Skip_the_spacebar")) Viola! That's it. If you don't want ANY control to react to the spacebar then do this... procedure Skip_the_spacebar(integer self, integer event, sequence parms) if parms[1] = ' ' then returnValue(-1) end if end procedure setHandler(Screen, w32HKeyDown, routine_id("Skip_the_spacebar")) Or if you have a dynamic situation in which the controls that can react, changes over time ... sequence SkipBars SkipBars = { Btn1, Btn3, Btn15, Fld2, Checkbox44, ... you get the idea...} procedure Skip_the_spacebar(integer self, integer event, sequence parms) if parms[1] = ' ' and find(getSelf(), SkipBars) then returnValue(-1) end if end procedure setHandler(Screen, w32HKeyDown, routine_id("Skip_the_spacebar")) What is the real problem you are trying to solve? Or to put it another way, what is the real effect you are trying to achieve? -- Derek Parnell Melbourne, Australia