#author("2023-08-27T20:42:23+09:00","","")
#author("2023-10-22T12:21:46+09:00","","")
#topicpath();

////////////////////////////////////////////////////////////////////////////////
* 目次 [#c87a6be6]
#contents();


////////////////////////////////////////////////////////////////////////////////
* xmodmap [#u7b7ffe5]
- 入力デバイス(キーボード、マウスなど)のキーやボタンのアサインを設定する。

//==============================================================================
** AltGr を他のキーに割り当てる [#p7f47463]
+ AltGr が物理的に存在するキーボードにて、チェコ語キー配列で AltGr キーを押離ししたときの xev の出力:
 KeyPress event, serial 38, synthetic NO, window 0x7e00001,
     root 0x941, subw 0x0, time 6139892, (173,-10), root:(1126,247),
     state 0x0, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
     XKeysymToKeycode returns keycode: 92
     XLookupString gives 0 bytes: 
     XmbLookupString gives 0 bytes: 
     XFilterEvent returns: False
 
 KeyRelease event, serial 38, synthetic NO, window 0x7e00001,
     root 0x941, subw 0x0, time 6140177, (173,-10), root:(1126,247),
     state 0x80, keycode 108 (keysym 0xfe03, ISO_Level3_Shift), same_screen YES,
     XKeysymToKeycode returns keycode: 92
     XLookupString gives 0 bytes: 
     XFilterEvent returns: False
-- 上記より、AltGr キーは以下であることが分かる
|~キーコード |~機能名 |
|108         |ISO_Level3_Shift |

+ AltGr キーを割り当てたい物理キーのキーコードを、同様に xev で調べる。
-- ここでは「変換」キーの機能を AltGr に置き換えることにするが、「変換」のキーコードは 100 となる。
     root 0x941, subw 0x0, time 18825870, (171,-6), root:(884,59),
 KeyPress event, serial 38, synthetic NO, window 0x9000001,
    root 0x941, subw 0x0, time 18825870, (171,-6), root:(884,59),
     state 0x0, keycode 100 (keysym 0xff23, Henkan_Mode), same_screen YES,
     XLookupString gives 0 bytes: 
     XmbLookupString gives 0 bytes: 
     XFilterEvent returns: False
 
 KeyRelease event, serial 38, synthetic NO, window 0x8600001,
     root 0x941, subw 0x0, time 18826142, (171,-6), root:(884,59),
     state 0x0, keycode 100 (keysym 0xff23, Henkan_Mode), same_screen YES,
     XLookupString gives 0 bytes: 
     XFilterEvent returns: False

+ AltGr の割当先キー(ここでは「変換」キー)のキーコードが分かったので、 ${HOME}/.Xmodmap に以下の設定をする:
 ! チェコ語キーボードで [変換] キーを AltGr に変更する
 keycode 100 =  ISO_Level3_Shift

+ 設定を反映する
-- 方法1:直ちに設定を反映させる
 $ xmodmap ~/.Xmodmap
-- 方法2:X または PC を再起動


//==============================================================================
** 参考リンク [#t903b16e]
- [[bearmini's blog>https://bearmini.hatenablog.com/entry/2013/07/12/161637]]
- [[xmodmap - ArchWiki>https://wiki.archlinux.jp/index.php/Xmodmap]]

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS