LoginSignup
2
2

More than 5 years have passed since last update.

Raspbian でキーマップの変更を毎回自動適用する

Last updated at Posted at 2016-05-31

Raspberry Pi 2 に Bluetooth ドングルを刺して Nintendo Wireless Keyboard を繋いで使うのに、Caps と Ctrl を入れ替えたいので作業の記録

追記:

Bluetooth のキーボードが再接続される度にキーマップが消えている事に気付きました。設定するべきは Bluetooth の再接続時のスクリプト!とわかったところまで。

設定箇所はそのうち調べる。とりあえず再接続が起きたら ~/.config/lxsession/LXDE-pi/autokey.sh を実行。

Ctrl と Caps の swap

~/.config/lxkeymap.cfg の option に ctrl:swapcaps を追加。

/home/pi/.config/lxkeymap.cfg
[Global]
layout = jp
variant = 
option = ctrl:swapcaps

複数指定する場合は , で区切ります。
例えば

option = lv3:ralt_switch,ctrl:swapcaps

出典:Raspberry Pi で学ぶ電子工作 補足情報

デスクトップ起動時に自動反映

なぜかリブートする度にキーマップを忘れてくれるので下記を設定。

/home/pi/.config/autostart/lxkeymap.desktop
[Desktop Entry]
Type=Application
Name=lxkeymap
Comment=Load international keyboard settings
NoDisplay=true
Exec=sh /home/pi/.config/lxsession/LXDE-pi/autokey.sh
NotShowIn=GNOME;KDE;XFCE;

出典:changed keyboard layout does not survive reboot

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2