Re: Minor issue when using alternate xkb groups

Ben Hutchings <ben-/[email protected]>
Newsgroups gmane.comp.window-managers.ion.general
Message-ID <[email protected]>
On Sat, 2008-05-24 at 10:58 +0200, Andreas Hübner wrote:
> I did have a very minor issue with ion3 when using alternate xkb groups.
> You may want to read the bug report I filed in the DBTS, if you are
> interested in this.
> [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=414974]
> 
> Summary (from someone who is not really familiar with X programming):
> X sets some additional bits in the XKeyEvent.state when you use an
> alternate xkb group.

Good work.  I looked into the Xkb header and found this:

    /*
     * BuildCoreState: Given a keyboard group and a modifier state,
     *                 construct the value to be reported an event.
     * GroupForCoreState:  Given the state reported in an event,
     *                 determine the keyboard group.
     * IsLegalGroup:   Returns TRUE if 'g' is a valid group index.
     */
#define XkbBuildCoreState(m,g)  ((((g)&0x3)<<13)|((m)&0xff))
#define XkbGroupForCoreState(s) (((s)>>13)&0x3)
#define XkbIsLegalGroup(g)      (((g)>=0)&&((g)<XkbNumKbdGroups))

So bits 13 and 14 of the modifiers together are the group number, and
should be ignored when looking up key bindings.  Your patch does that
much.  I wonder whether evil_grab_key() also needs to handle them?

Ben.

-- 
Ben Hutchings
It is easier to change the specification to fit the program than vice versa.
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQBIOdQi79ZNCRIGYgcRAlNCAJ9SHoQiiSQAmNOihtMBRc/P6u/IvgCbBWCh
RZRtOOARWqH3Aizyq40Ayac=
=M2+h
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.