3

In some applications entering capital letters works like hitting ESC key.

Reproducing:

  • Open LibreOffice document
  • Select "Save as" (Unity dialog)
  • Hit "Create folder"
  • Enter a capital letter using shift key (e.g. Shift+A)

As this point the creating of the new folder get canceled. (like ESC key was hit)

This behavior is also present in many different programs and games.

Analyzing the situation with xev (Hitting Shift+d)

# xev
KeyPress event, serial 37, synthetic NO, window 0x4c00001,
    root 0x259, subw 0x0, time 994702, (15,-13), root:(987,197),
    state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

FocusOut event, serial 37, synthetic NO, window 0x4c00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 37, synthetic NO, window 0x4c00001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 37, synthetic NO, window 0x0,
    keys:  89  0   0   0   0   1   4   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyPress event, serial 37, synthetic NO, window 0x4c00001,
    root 0x259, subw 0x0, time 994927, (15,-13), root:(987,197),
    state 0x11, keycode 40 (keysym 0x44, D), same_screen YES,
    XLookupString gives 1 bytes: (44) "D"
    XmbLookupString gives 1 bytes: (44) "D"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
    root 0x259, subw 0x0, time 995062, (15,-13), root:(987,197),
    state 0x11, keycode 40 (keysym 0x44, D), same_screen YES,
    XLookupString gives 1 bytes: (44) "D"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4c00001,
    root 0x259, subw 0x0, time 995395, (15,-13), root:(987,197),
    state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

I think, that the FocusOut and FocusIn events look suspicious.

Linux: Ubuntu 14.04 LTS 32bit, Unity

How can I fix my system? Any ideas or further tests are welcome!

Edit: The solution

I used to configure language switch to LeftShift+RightShift. This worked for years, but become the problem at some point. Anyway configuring switch to any other key combination solved the problem.

serenesat
  • 1,326
Boris Brodski
  • 267
  • 4
  • 11
  • When you pressed "Shift-D" the state should be 0x1 not 0x11. It indicates that both Shift and Mod2 are enabled. Did you change anything with Xmodmap or XKB? – nitishch Aug 02 '15 at 10:57
  • Yes, I played wth Xmodmap, but I removed .Xmodmap and undone the other stuff I did (I hope). Then I restarted the system. Any idea, how can I find the problem? Thank you!! – Boris Brodski Aug 02 '15 at 11:38

2 Answers2

5
FocusOut event, serial 37, synthetic NO, window 0x4c00001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 37, synthetic NO, window 0x4c00001, mode NotifyUngrab, detail NotifyAncestor

What happened when you pressed A with Shift held is a passive grab: there's an X client which has exclusive control over this key combination, and when the key combination is pressed, the event is routed only to that client, not to xev or anyone else. xev does report the client grabbing the key combination when it happens and ungrabbing it when it's over.

In layman's terms, there's a program that's defined Shift+A as a global keybinding. It's probably a typo where you meant to bind Shift+Alt+key or Win+Shift+A something.

In Manipulating X key and pointer grabs on the command line I asked how to find who the grabber is. The best way I found only reports active grab, so the key has to be down when the information is queried.

  1. Install xdotool if you don't already have it.
  2. Run sleep 1; xdotool key XF86LogGrabInfo.
  3. Within one second, press and hold Shift+A. Hold until xdotool has run.
  4. Look in the X server log for information about the grab. The typical location of the X server log is /var/log/Xorg.0.log (the 0 reflects the display number, i.e. the number in $DISPLAY: if $DISPLAY is :1 or :1.0 then look at /var/log/Xorg.1.log, etc.).

Here's some sample output showing that the key I pressed was a key binding defined by sawfish:

[2292688.331] Active grab 0x41602244 (core) on device 'Virtual core keyboard' (3):
[2292688.331]       client pid 6745 sawfish 
[2292688.331]       at 2292687547 (from passive grab) (device thawed, state 3)
[2292688.331]         core event mask 0x3
[2292688.331]       passive grab type 2, detail 0x4e, activating key 78
[2292688.331]       owner-events false, kb 0 ptr 0, confine 0, cursor 0x0
[2292688.331] (II) End list of active device grabs
1

On Ubuntu 16.04 LTS 64 bit I had the similar behavior in "Files":

  • You can rename files and folders in "View items as a grid of icons" mode
  • In the "View items as a list" mode:
    • Pressing right shift while renaming is similar to pressing ESC
    • Pressing left shift works
    • Pressing left shift+any letter is similar to pressing ESC, left shift+any letter

As a result it's not possible to enter any capital letters in the "View items as a list" while renaming a file or a folder.

The solution:

  • Go to System settings/Keyboard
  • Switch to the Shortcuts tab
  • Select Universal access on the left hand side
  • Remove zoom bindings
Boris Brodski
  • 267
  • 4
  • 11