0

For some reason some keys only send a KeyRelease event and not a KeyPress one:

This is what I get when I press Print Screen. This makes the Print Screen key unusuable for remapping to keys that send both a KeyPress and a KeyRelease event.

[user@Laptop ~]$ xmodmap -e "keycode 107 = Delete"
[user@Laptop ~]$ sleep 1 && xev
Outer window is 0x5400001, inner window is 0x5400002

PropertyNotify event, serial 8, synthetic NO, window 0x5400001,
    atom 0x27 (WM_NAME), time 15113402, state PropertyNewValue

PropertyNotify event, serial 9, synthetic NO, window 0x5400001,
    atom 0x22 (WM_COMMAND), time 15113402, state PropertyNewValue

PropertyNotify event, serial 10, synthetic NO, window 0x5400001,
    atom 0x28 (WM_NORMAL_HINTS), time 15113402, state PropertyNewValue

CreateNotify event, serial 11, synthetic NO, window 0x5400001,
    parent 0x5400001, window 0x5400002, (10,10), width 50, height 50
border_width 4, override NO

PropertyNotify event, serial 13, synthetic NO, window 0x5400001,
    atom 0x209 (_KDE_NET_WM_USER_CREATION_TIME), time 15113404, state PropertyNewValue

PropertyNotify event, serial 14, synthetic NO, window 0x5400001,
    atom 0x13a (WM_PROTOCOLS), time 15113404, state PropertyNewValue

MapNotify event, serial 15, synthetic NO, window 0x5400001,
    event 0x5400001, window 0x5400002, override NO

ConfigureNotify event, serial 26, synthetic NO, window 0x5400001,
    event 0x5400001, window 0x5400001, (0,0), width 178, height 178,
    border_width 0, above 0x5c00018, override NO

ReparentNotify event, serial 26, synthetic NO, window 0x5400001,
    event 0x5400001, window 0x5400001, parent 0x363ae5b,
    (0,0), override NO

PropertyNotify event, serial 29, synthetic NO, window 0x5400001,
    atom 0x148 (_NET_WM_STATE), time 15113406, state PropertyNewValue

MapNotify event, serial 29, synthetic NO, window 0x5400001,
    event 0x5400001, window 0x5400001, override NO

VisibilityNotify event, serial 29, synthetic NO, window 0x5400001,
    state VisibilityPartiallyObscured

Expose event, serial 29, synthetic NO, window 0x5400001,
    (0,0), width 1, height 1, count 0

PropertyNotify event, serial 29, synthetic NO, window 0x5400001,
    atom 0x169 (WM_STATE), time 15113407, state PropertyNewValue

PropertyNotify event, serial 30, synthetic NO, window 0x5400001,
    atom 0x1fa (_KDE_NET_WM_ACTIVITIES), time 15113407, state PropertyNewValue

PropertyNotify event, serial 32, synthetic NO, window 0x5400001,
    atom 0x148 (_NET_WM_STATE), time 15113454, state PropertyNewValue

PropertyNotify event, serial 32, synthetic NO, window 0x5400001,
    atom 0x142 (_NET_WM_DESKTOP), time 15113454, state PropertyNewValue

PropertyNotify event, serial 32, synthetic NO, window 0x5400001,
    atom 0x148 (_NET_WM_STATE), time 15113454, state PropertyNewValue

PropertyNotify event, serial 32, synthetic NO, window 0x5400001,
    atom 0x142 (_NET_WM_DESKTOP), time 15113454, state PropertyNewValue

PropertyNotify event, serial 33, synthetic NO, window 0x5400001,
    atom 0x13f (_NET_FRAME_EXTENTS), time 15113458, state PropertyNewValue

PropertyNotify event, serial 33, synthetic NO, window 0x5400001,
    atom 0x1a8 (_KDE_NET_WM_FRAME_STRUT), time 15113458, state PropertyNewValue

PropertyNotify event, serial 33, synthetic NO, window 0x5400001,
    atom 0x1e6 (_NET_WM_ALLOWED_ACTIONS), time 15113458, state PropertyNewValue

PropertyNotify event, serial 36, synthetic NO, window 0x5400001,
    atom 0x148 (_NET_WM_STATE), time 15113459, state PropertyNewValue

FocusIn event, serial 36, synthetic NO, window 0x5400001,
    mode NotifyNormal, detail NotifyNonlinear

KeymapNotify event, serial 36, synthetic NO, window 0x0,
    keys:  4294967208 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   0   0   0   0   0   0   

VisibilityNotify event, serial 36, synthetic NO, window 0x5400001,
    state VisibilityUnobscured

Expose event, serial 36, synthetic NO, window 0x5400001,
    (1,0), width 177, height 1, count 4

Expose event, serial 36, synthetic NO, window 0x5400001,
    (0,1), width 178, height 9, count 3

Expose event, serial 36, synthetic NO, window 0x5400001,
    (0,10), width 10, height 58, count 2

Expose event, serial 36, synthetic NO, window 0x5400001,
    (68,10), width 110, height 58, count 1

Expose event, serial 36, synthetic NO, window 0x5400001,
    (0,68), width 178, height 110, count 0

ConfigureNotify event, serial 36, synthetic YES, window 0x5400001,
    event 0x5400001, window 0x5400001, (0,31), width 178, height 178,
    border_width 0, above 0x0, override NO

PropertyNotify event, serial 36, synthetic NO, window 0x5400001,
    atom 0x1fa (_KDE_NET_WM_ACTIVITIES), time 15113459, state PropertyNewValue

PropertyNotify event, serial 36, synthetic NO, window 0x5400001,
    atom 0x148 (_NET_WM_STATE), time 15113459, state PropertyNewValue

PropertyNotify event, serial 36, synthetic NO, window 0x5400001,
    atom 0x1e4 (_NET_WM_ICON_GEOMETRY), time 15113743, state PropertyNewValue

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

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

KeymapNotify event, serial 37, synthetic NO, window 0x0,
    keys:  4294967290 0   0   0   0   0   0   0   0   0   0   0   0   8   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 37, synthetic NO, window 0x5400001,
    root 0xdf, subw 0x0, time 15117991, (953,482), root:(953,513),
    state 0x0, keycode 107 (keysym 0xffff, Delete), same_screen YES,
    XLookupString gives 1 bytes: (7f) ""
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x5400001,
    root 0xdf, subw 0x0, time 15125487, (953,482), root:(953,513),
    state 0x0, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

FocusOut event, serial 40, synthetic NO, window 0x5400001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 40, synthetic NO, window 0x5400001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 40, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   65  0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

KeyRelease event, serial 40, synthetic NO, window 0x5400001,
    root 0xdf, subw 0x0, time 15125490, (953,482), root:(953,513),
    state 0x8, keycode 70 (keysym 0xffc1, F4), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x5400001,
    root 0xdf, subw 0x0, time 15125494, (953,482), root:(953,513),
    state 0x8, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

ClientMessage event, serial 40, synthetic YES, window 0x5400001,
    message_type 0x13a (WM_PROTOCOLS), format 32, message 0x138 (WM_DELETE_WINDOW)

Is there any way I can get those keys to send both events?

  • You probably have some program which has asked to grab that key when pressed. Check the bindings in your window manager or desktop setup. – meuh Apr 13 '18 at 7:07
  • Please don't use grep on diagnostic output, you filter away important information. You probably have FocusIn/FocusOut events right when you press the Print Screen key, which means some other application or the window manager is stealing the keypress events. But with grep it's impossible to see if this is really the case. – dirkt Apr 13 '18 at 8:29
  • Showing full output now – simplegamer Apr 14 '18 at 2:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.