1

我有一个按钮,可以通过蓝牙连接到我的电脑。但是,它模拟了音量增大按钮,我想区分蓝牙按钮和“真正的”键盘音量增大按钮。

我已经使用xev. 它们看起来像这样:

键盘音量增大按钮

  KeyPress event, serial 34, synthetic NO, window 0x1800001,
    root 0x14e, subw 0x0, time 2849770, (-88,658), root:(876,680),
    state 0x1, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

蓝牙按钮

  KeyPress event, serial 34, synthetic NO, window 0x1800001,
    root 0x14e, subw 0x0, time 2858907, (-88,658), root:(876,680),
    state 0x1, keycode 123 (keysym 0x1008ff13, XF86AudioRaiseVolume), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

bluetoothctl我通过Arch Linux连接了蓝牙按钮。

现在我想添加到我~/.config/i3/config的类似

bindcode 123 exec "~/doStuff.sh"

但是,这确实改变了我的键盘按钮以及我的蓝牙按钮。但我想添加一些改变蓝牙按钮的东西,而不是键盘按钮。

4

1 回答 1

0

经过大量研究,我找到了 ruby​​ gem bluebutton( https://github.com/kinnalru/bluebutton )。在那里,我可以定义我在xinput list蓝牙按钮中找到的名称,并在配置中添加要执行的命令。

于 2019-05-23T19:02:27.850 回答