Commit e7e6d9e4f527fdf26d200496175842474c62b3d4

A patch sent to me by "M. Vefa Bicakci" <bicave (at) superonline.com> who
discussed it with bhughes on irc.

It fixes the fact that qt's shortcuts currently do not respect a change to
x11's keymap group. Configure x11 to have two keyboard layouts

setxkbmap -layout us,de
setxkbmap -option -option grp:shifts_toggle

The second command allows switching with Shift+Shift between them. It's
easier to set this up in kde's "kcmshell4 keyboard_layout".

1. Configure a shortcut for Ctrl+y (in the de,us example) or any other key
that changes it's location when switching from one layout to the other. In
my example the y and z key change their place when switching between
de,us.

2. Type y (see either y or z), Trigger Ctrl+y, Everything is ok.

3. Switch Layouts.

4. Type the key formerly known as y. You should see either y or z
depending on your start point. It's clearly not the same as under 1.,
Trigger Ctrl+y, The action still triggers. With this patch applied you
would have to type ctrl+z to trigger the action.

Mike
  
283283}
284284
285285enum { MaxBits = sizeof(uint) * 8 };
286enum { AlternativeKeymapMask1 = 1 << 13 };
287enum { AlternativeKeymapMask2 = 1 << 14 };
286288static QString translateKeySym(KeySym keysym, uint xmodifiers,
287289 int &code, Qt::KeyboardModifiers &modifiers,
288290 QByteArray &chars, int &count);
299299 // always use them when determining the baseKeySym)
300300 KeySym baseKeySym;
301301 uint consumedModifiers;
302 if (!XkbLookupKeySym(X11->display, xkeycode, (xmodifiers & (LockMask | qt_num_lock_mask)),
303 &consumedModifiers, &baseKeySym))
302 if (!XkbLookupKeySym(X11->display, xkeycode,
303 (xmodifiers & ~(ShiftMask | Mod1Mask | Mod2Mask | Mod3Mask | Mod4Mask | Mod5Mask)),
304 &consumedModifiers, &baseKeySym))
304305 return QList<int>();
305306
306307 QList<int> result;
338338 for (int j = 0; j < num1Bits; ++j) {
339339 if (i & (1 << j))
340340 val |= (1 << pos1Bits[j]);
341 }
342
343 if (xmodifiers & AlternativeKeymapMask1) {
344 val |= AlternativeKeymapMask1;
345 }
346 if (xmodifiers & AlternativeKeymapMask2) {
347 val |= AlternativeKeymapMask2;
341348 }
342349
343350 if ((xmodifiers & val) != val)