You are not logged in.

#1 2023-04-12 11:25:43

bertulli
Member
Registered: 2021-11-25
Posts: 48

[SOLVED]Why are some keypress "hijacked", and how can I redirect them?

Hi all,
I recently noticed in my current Emacs that some key presses are not detected by the program, specifically the combination Ctrl+Alt+o. I'm using XWayland due to a temporary necessity to use Xorg (actually, xdotool), therefore inspecting with xev I see:

If I try to press Ctrl+Alt+i:

KeyPress event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2424746, (255,-17), root:(355,152),
    state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2424751, (255,-17), root:(355,152),
    state 0x18, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2425943, (255,-17), root:(355,152),
    state 0x1c, keycode 31 (keysym 0x69, i), same_screen YES,
    XLookupString gives 1 bytes: (09) "	"
    XmbLookupString gives 1 bytes: (09) "	"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2426023, (255,-17), root:(355,152),
    state 0x1c, keycode 31 (keysym 0x69, i), same_screen YES,
    XLookupString gives 1 bytes: (09) "	"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2426800, (255,-17), root:(355,152),
    state 0x1c, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2426811, (255,-17), root:(355,152),
    state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Instead, with Ctrl+Alt+o:

KeyPress event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2427577, (255,-17), root:(355,152),
    state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2427587, (255,-17), root:(355,152),
    state 0x18, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

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

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

KeymapNotify event, serial 37, synthetic NO, window 0x0,
    keys:  2   0   0   0   32  0   0   0   1   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 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2429115, (255,-17), root:(355,152),
    state 0x1c, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x2200001,
    root 0x8ba, subw 0x0, time 2429120, (255,-17), root:(355,152),
    state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

Why is there such difference (and, if you feel like it, what is the difference)? And how can I make that sequence available to programs?

Thanks!

Last edited by bertulli (2023-04-12 15:20:04)


We are still learning
    - wise people

Offline

#2 2023-04-12 11:36:51

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,344

Re: [SOLVED]Why are some keypress "hijacked", and how can I redirect them?

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

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

KeymapNotify event, serial 37, synthetic NO, window 0x0,
    keys:  2   0   0   0   32  0   0   0   1   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

There's a passive grab on the shortcut.

sleep 5; xdotool key "XF86LogGrabInfo"

Press the shortcut and hold it until xdotool fired - the grabs are then logged in your xorg log and the one for the shortcut is the active one.
Will tell you which process holds the grab.

Online

#3 2023-04-12 15:19:05

bertulli
Member
Registered: 2021-11-25
Posts: 48

Re: [SOLVED]Why are some keypress "hijacked", and how can I redirect them?

Thanks! Did as suggested, then after a quick search I found on ~/.local/share/xorg/ :

[   951.920] (II) Printing all currently active device grabs:
[   951.920] Active grab 0x42400034 (xi2) on device 'Virtual core keyboard' (3):
[   951.920]       client pid 2072 /usr/lib/gpaste/gpaste-daemon 
[   951.920]       at 950814 (from passive grab) (device thawed, state 1)
[   951.920]       xi2 event mask for device 3: 0x40000
[   951.921]       passive grab type 2, detail 0x20, activating key 32
[   951.921]       owner-events false, kb 1 ptr 0, confine 0, cursor 0x0
[   951.921] (II) End list of active device grabs

(along with a bunch of other listings whose meaning I don't know). They were some keybindings supervised by gpaste. Deleted the package (which I no longer use) and kille the daemon the problem is solved. Thanks! smile

Last edited by bertulli (2023-04-12 15:19:40)


We are still learning
    - wise people

Offline

Board footer

Powered by FluxBB