一部のキーストロークはKeyReleaseイベントのみを送信します。

一部のキーストロークはKeyReleaseイベントのみを送信します。

何らかの理由で、一部のキーストロークはKeyReleaseイベントのみを送信し、KeyPressイベントは送信しません。

「Print Screen」を押すと表示される内容です。これにより、Print ScreenキーがイベントKeyPressとイベントの両方を送信するキーに再マップされるのを防ぎますKeyRelease

[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)

これら2つのイベントを送信するためにこれらのキーを取得する方法はありますか?

ベストアンサー1

おすすめ記事