xevの出力はどういう意味ですか?

xevの出力はどういう意味ですか?

キーボードのいくつかのキーを再マッピングしたいです。特に、ファンクションキーを押しながらF1キーを押してからスクリプトを実行したいと思います。私はこれがxevキー押下に関連するキーコードを見つけるのに役立つことを知っています。たとえば、キーを押すと、次のような結果xが表示されます。

KeyPress event, serial 41, synthetic NO, window 0x2600001,
    root 0xae, subw 0x0, time 1597243, (-190,43), root:(910,336),
    state 0x0, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (78) "x"
    XmbLookupString gives 1 bytes: (78) "x"
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x2600001,
    root 0xae, subw 0x0, time 1597363, (-190,43), root:(910,336),
    state 0x0, keycode 53 (keysym 0x78, x), same_screen YES,
    XLookupString gives 1 bytes: (78) "x"
    XFilterEvent returns: False

これは私にとって意味があります。

しかし、Function-F1を押すとどうなるかわかりません。Function-F1を押すとWindowsボタンを押しながら文字を入力しているように見えるのはなぜですかl

xevFunction-F1 を押すと出力は次のようになります。

KeyPress event, serial 41, synthetic NO, window 0x2600001,
    root 0xae, subw 0x0, time 1735349, (-157,221), root:(943,514),
    state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 41, synthetic NO, window 0x2600001,
    root 0xae, subw 0x0, time 1735350, (-157,221), root:(943,514),
    state 0x40, keycode 46 (keysym 0x6c, l), same_screen YES,
    XLookupString gives 1 bytes: (6c) "l"
    XmbLookupString gives 1 bytes: (6c) "l"
    XFilterEvent returns: False

MappingNotify event, serial 41, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyPress event, serial 41, synthetic NO, window 0x2600001,
    root 0xae, subw 0x0, time 1735356, (-157,221), root:(943,514),
    state 0x40, keycode 160 (keysym 0x1008ff2d, XF86ScreenSaver), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x2600001,
    root 0xae, subw 0x0, time 1735357, (-157,221), root:(943,514),
    state 0x40, keycode 160 (keysym 0x1008ff2d, XF86ScreenSaver), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

MappingNotify event, serial 42, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

KeyRelease event, serial 42, synthetic NO, window 0x2600001,
    root 0xae, subw 0x0, time 1735463, (-157,221), root:(943,514),
    state 0x40, keycode 46 (keysym 0x6c, l), same_screen YES,
    XLookupString gives 1 bytes: (6c) "l"
    XFilterEvent returns: False

KeyRelease event, serial 43, synthetic NO, window 0x2600001,
    root 0xae, subw 0x0, time 1735470, (-157,221), root:(943,514),
    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

テキストウィンドウに焦点を合わせた状態でFunction-F1を押すと文字が入力されますl

背景情報:東芝r835でLubuntu 11.10を実行。役に立つ可能性のある追加情報を提供します。

編集する:

比較のためにFunction-F12と入力すると、次の結果が表示されます。

KeyPress event, serial 41, synthetic NO, window 0x2200001,
    root 0xae, subw 0x0, time 8369184, (-620,473), root:(480,766),
    state 0x0, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyRelease event, serial 41, synthetic NO, window 0x2200001,
    root 0xae, subw 0x0, time 8369344, (-620,473), root:(480,766),
    state 0x0, keycode 78 (keysym 0xff14, Scroll_Lock), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

F1〜F12キーに特別なものがあることを確認したかったのですが、少なくとも一部は期待通りに動作するようです。

ベストアンサー1

「Function-F1」と言うと、Fnノートブックの隅にある面白い小さなキーを押してから、F1キーボードの左上隅にあるキーを押すことを意味します。そして、いくつかのノートブックキーボードにある追加のキー(「スリープ」など)の1つをマッピングしようとしています。

このキーは実際に複数のキーを押すようです。まずWin+をL組み合わせて扱います。 Windowsでは、このショートカットは画面をロックしますが、スクリーンセーバーを起動しません。

次に、XF86ScreenSaverのマッピングが表示されます。これはおそらくXが一種のスリープキーコードを見ていることを意味します。私はノートパソコンのキーボードのキーは、Windowsユーザーが画面をすばやくロックし、スクリーンセーバーを有効にするのを簡単にするために、実際にWin+ L+ 3つのキーコードを送信することだと思います。Sleep

これをフィルタリングする良い方法があるかどうかはわかりません。 LinuxFnカーネルは通常キーボードのキーストロークを認識せず、代わりにキーボードがカーネルに通知するコードを変更します。 USB RFパワーポイントリモコンを使用しようとすると開発事務室Linuxでは、デモを開始/停止するボタンが代替コードF5Escキーコードを送信する不都合なコントロールにすぎないことを発見しました。b画面を空白に送るなど、他のボタンも同じくらいです。

おすすめ記事