はじめに
ubuntu ではlogicool optionが提供されていないので、以前はeasy strokeを使ってマウスのキーバインドを変更していた
ubuntu20.04にUpdateしたら、easy strokeでマウスボタンにキーバインドを設定する機能がうまく動かなかったので、別の方法をさがした
結論 logiopsを入れる
sudo apt install cmake libevdev-dev libudev-dev libconfig++-dev
git clone git@github.com:PixlOne/logiops.git
cd logiops
mkdir build
cd build
cmake ..
make
sudo make install
これでインストールできる
設定ファイルの書き方
サンプルはgitのリポジトリにある
https://github.com/PixlOne/logiops/blob/master/logid.example.cfg
今回はマウスホイールのクリックにF3キーを割当たかったので以下の感じ
/etc/logid.cfg
devices: (
{
name: "Wireless Mouse MX Master 3";
buttons: (
{
# Wheel press
cid: 0x52;
action =
{
type: "Keypress";
keys: ["KEY_F3"];
};
}
);
}
);
その他
cid は以下のコマンドで調べられる(どのボタンがどのcidかは分からなかったので、実際に設定してみて動きを見た)
$ sudo logid -v DEBUG
[DEBUG] Unsupported device /dev/hidraw0 ignored
[INFO] Device found: Wireless Mouse MX Master 3 on /dev/hidraw1:255
[DEBUG] /dev/hidraw1:255 remappable buttons:
[DEBUG] CID | reprog? | fn key? | mouse key? | gesture support?
[DEBUG] 0x50 | | | YES |
[DEBUG] 0x51 | | | YES |
[DEBUG] 0x52 | YES | | YES | YES
[DEBUG] 0x53 | YES | | YES | YES
[DEBUG] 0x56 | YES | | YES | YES
[DEBUG] 0xc3 | YES | | YES | YES
[DEBUG] 0xc4 | YES | | YES | YES
[DEBUG] 0xd7 | YES | | | YES
[DEBUG] Thumb wheel detected (0x2150), capabilities:
[DEBUG] timestamp | touch | proximity | single tap
[DEBUG] YES | YES | YES | YES
[DEBUG] Thumb wheel resolution: native (18), diverted (120)
ちなみにMX Master3のcidは以下
wheel Press: 0x52;
Back Button: 0x53;
Forward Button: 0x56;
Gesture Button: 0xc3;
Toggle SmartShift: 0xc4;