开发者

in X is it possible to detect when shift is pressed and released when it isn't modifying another key?

as in the title, it doesn't appear to generate an event unless another key/button is pressed at the same开发者_C百科 time. thanks, james


Running xev and pressing shift gives me this:


KeyPress event, serial 34, synthetic NO, window 0x5a00001,
    root 0xf7, subw 0x0, time 1739516541, (174,173), root:(1021,367),
    state 0x10, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x5a00001,
    root 0xf7, subw 0x0, time 1739516717, (174,173), root:(1021,367),
    state 0x11, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

So yes, it is possible.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜