xkb: Switch delay to a group
daniel at fooishbar.org
Fri Feb 5 02:40:27 PST 2010
On Thu, Feb 04, 2010 at 10:18:23PM +0300, Ilya Murav'jov wrote:
> Daniel Stone пишет:
> >> That's the wonderful thing about xkbActions.c. The filter system has to
> >> be rewritten, too - it needs per-level granularity. Maybe there can be a
> >> more general approach towards canceling actions when doing that.
> >> But maybe you would want to put the focus on switch-group-on-release
> >> first. If want to try it without Press/Release knowledge inside the
> >> handler you might want to try to skip the first event. If that works
> >> together with an option to select between when to trigger the switch
> >> (press/release), that would be an improvement already.
> > Actually, it's really not that bad. In the group-switch handler, you
> > could just set a flag for 'maybe switch groups when all keys are up'.
> > As the handler gets called for all key events, you could then just clear
> > the 'maybe switch' flag when another key gets pressed.
> Ok, your variant is better, but still not good one; as far as I
> understand "just clear the 'maybe switch' flag" still needs to go
> through all xkbi->filters vector to find the one with that flag.
The filter should get called for _any_ key press and release. So you
get Ctrl+Shift and set the flag in the filter private. Then someone
presses, say, B, which should cause the very same filter handler to get
called _again_. You notice it's another keypress, and clear the flag.
In the filter, on key release events, you just watch the number of keys
currently down, and if it's currently zero, you either make the group
switch or not, depending on the flag.
> So, if I get some useful patches for the issue I attach them to the bug
> http://bugs.freedesktop.org/show_bug.cgi?id=865, ok?
Sounds good. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20100205/0a991b7c/attachment.pgp
More information about the xorg-devel