Re: Win32Lib Losing Keys

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek Parnell wrote:
> cklester wrote:
> > 
> > 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?
> 
> 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"))

That doesn't work. The SPACEBAR keypress still causes the button
to click. I even tried the following, which
doesn't allow any kepress to go through, yet the button still gets
clicked with the spacebar.

procedure Window1_onKeyPress (integer self, integer event, sequence
params)--params is ( int keyCode, int shift )
	setText(StatusBar2, "Got key " & params[1] & "." )
	returnValue(-1)
end procedure
setHandler( Screen, w32HKeyDown, routine_id("Window1_onKeyPress"))

> What is the real problem you are trying to solve?

Being able to press the spacebar without having a recently clicked
button react to it.

> Or to put it another 
> way, what is the real effect you are trying to achieve?

When the user types, I'm using wPuts() to put it to a part of the
window. They can click buttons to do other things, but when they
start typing again, I expect to be able to receive those events and
wPuts() them to the window again. But it doesn't work that way, yet. :)

> Derek Parnell

Thanks, Derek! 

-=ck
"Programming in a state of EUPHORIA."

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu