nanogui: X11 KEY_UP event


Previous by date: 17 May 2001 12:48:28 -0000 Re: GTK+ port to nano-X, Amit Kulkarni
Next by date: 17 May 2001 12:48:28 -0000 Re: multithread question, Jordan Crouse
Previous in thread: 17 May 2001 12:48:28 -0000 Re: X11 KEY_UP event, tomasz motylewski
Next in thread:

Subject: Re: X11 KEY_UP event
From: Timo Ketola ####@####.####
Date: 17 May 2001 12:48:28 -0000
Message-Id: <3B03C7C6.DEE9609D@Epec.fi>

tomasz motylewski wrote:
> 
> On Tue, 8 May 2001, Timo Ketola wrote:
> 
> > I'm a little lost with the X11 driver. I need to know when a key is
> > released and watch for KEY_UP events. Basically it works fine but the
> > problem is the auto repeat function. For every auto repeat cycle I get
> > KEY_DOWN  * AND KEY_UP *  event (DOWN UP DOWN UP DOWN UP ... DOWN UP; I
> > was expecting a sequence of DOWN DOWN DOWN ... DOWN UP). These extra
> > KEY_UP events makes it impossible to distinguish between multiple key
> > presses and one long press.
> >
> > Is this a property of X11 and is there any way to modify it's behaviour?
> 
> I think these key ups are in fact generated by the keyboard. So autorepetition
> has to be switched off at rather low level (kbdrate - unfortunately it does not
> seem to disable repetition comletely.).
> 
> What we did here in BFAD was to have a filter receiving characters.
> If after Key_up key_down was received "immediately" (say within 50ms) such pair
> of events was ignored.

Thanks for a hint! It solved the problem. I didn't even have to put any
delay into the code.

One little problem remains, however. If I klick a key shortly enough, I
don't get the up event. It is not lost, though, it comes through with
any other events (change the focus or anything). I debugged the kbd_x11
a little and noticed that the event doesn't appear even there. But this
is very hard to debug as the event comes immediately if I change the
focus to the debugger and the state is lost.

But after all, it is now very good for my needs.

--
Timo

Previous by date: 17 May 2001 12:48:28 -0000 Re: GTK+ port to nano-X, Amit Kulkarni
Next by date: 17 May 2001 12:48:28 -0000 Re: multithread question, Jordan Crouse
Previous in thread: 17 May 2001 12:48:28 -0000 Re: X11 KEY_UP event, tomasz motylewski
Next in thread:


Powered by ezmlm-browse 0.20.