xkb should be extended to be able to recognize a sequence of key presses
and key releases and fire action upon it. Again, this would be an
extension, not a violation of current standard.

Currently, the group switching is defined in
/usr/share/X11/xkb/symbols/group with parts like

partial modifier_keys
xkb_symbols "lalt_lshift_toggle" {
    virtual_modifiers Alt;
    key <LALT> {
        symbols[Group1] = [ NoSymbol, ISO_Next_Group ],
        virtualMods= Alt
    };
    key <LFSH> {
        type[Group1]="PC_ALT_LEVEL2",
        symbols[Group1] = [ Shift_L, ISO_Next_Group ]
    };
};

The following is what this part of the file would look like after
appropiate changes in xkb code:

xkb_sequences "lalt_lshift_toggle" {
    sequence { keydown <LALT>, keydown <LFSH>, keyup <LFSH> } = ISO_Next_Group;
    sequence { keydown <LFSH>, keydown <LALT>, keyup <LALT> } = ISO_Next_Group;
}


For this to work
1) http://www.x.org/docs/XKB/XKBproto.pdf need to be extended with a small 
chapter
2) http://cgit.freedesktop.org/xorg/xserver/tree/xkb - code the run time check 
for sequences; changes to xkm format required
3) http://cgit.freedesktop.org/xorg/app/xkbcomp/tree/ - code the parsing of 
"xkb_sequences", "keydown", and "keyup" keywords


At least this is my impression after a day of investigation. I know this seems 
like unnecessarily big change compared to Ilya's patch. But, basically, that is 
what I mean by "clean solution". Unfortunatelly, it is more of a "dream 
solution", since I feel I will hardly be able to code this..

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xorg-server in Ubuntu.
https://bugs.launchpad.net/bugs/36812

Title:
  Keyboard layout change on hotkeys press instead of release and do not
  work well with shortcuts

Status in GNOME Control Center:
  Unknown
Status in X.Org X server:
  In Progress
Status in “control-center” package in Ubuntu:
  Invalid
Status in “xorg-server” package in Ubuntu:
  Fix Released

Bug description:
  This is a bug about shortcuts mapped to combinations which include
  each other.

  For example, if we have Ctrl+Shift (for keyboard layout) and Ctrl+Shift+N (to 
open a new terminal), then we are practically unable to use the second 
shortcut; this is what happens:
  Ctrl press  (nothing happens)
  Shift press (keyboard layout change)
  N (a simple N appears, since a shortcut has already fired)

  The expected behavior is to fire shortcuts on the release (not on
  press) of the special keys (ctrl,shift,alt, etc) which is also how
  Windows behave. This is a serious problem for bilingual layouts,
  typically using Alt+Shift or Ctrl+Shift for keyboard layout change.

  For users being affected by this problem, the easiest solution for now is to 
add this PPA in your repositories:
  https://launchpad.net/~oded-geek/+archive/xorg-patches

  Practical summary of this bug for ubuntu developers (since reading 120 
comments is impractical for most):
  This problem is a really old (since 2004) issue of the xkb part of xorg; the 
main discussion was made upstream in freedesktop-bugs #865. There has been a 
patch from Ilya Murav'jov for upstream (#55), and attached here (#61).
  Upstream xorg has refused to apply the patch, mainly because it "explicitly 
contradicts the (xkb) spec"  (#84, #91).
  This patch has been reported to work for many people without any problems, 
and there is also a PPA by Oded Arbel (#95) where he maintains a patched 
version of the ubuntu xorg.
  The proper resolution of this bug would be to apply this patch to the 
upstream xorg, or at minimum to the official ubuntu xorg package.

To manage notifications about this bug go to:
https://bugs.launchpad.net/gnome-control-center/+bug/36812/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to