我在 Wacom 设备上绑定了一个按钮,如下所示:
xsetwacom --set "Wacom Cintiq 13HD touch Pad pad" button 8 key "]"
当我按住按钮时,只会产生一个按键事件。我该如何解决?
答案1
长话短说
抱歉,还没有其中之一...您可以在此位置建议对此进行编辑。
xsetwacom
这与如何解析您提供的密钥有关。如果您没有指定pressed( +
)或released( -
),并且您绑定的键不是修饰键,则假定您只想按该键一次。在设置绑定后,我们可以通过调查设备的属性来看到这一点。我们可以通过 看到这一点xsetwacom -s --get "Wacom Cintiq 13HD touch Pad pad"
。它产生如下输出:
Property 'Wacom Tablet Area' does not exist on device.
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "1" "key +XF86Finance -XF86Finance "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "2" "+XF86WWW -XF86WWW "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "3" "+Control_L +s -s "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "8" "+bracketright -bracketright "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "9" "+bracketleft "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "10" "+Control_L +y -y "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "11" "+KP_Add -KP_Add "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "12" "+Control_L +z -z "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "13" "+KP_Subtract -KP_Subtract "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "ToolDebugLevel" "0"
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "TabletDebugLevel" "0"
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Suppress" "2"
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "RawSample" "4"
Property 'Wacom Pressurecurve' does not exist on device.
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Mode" "Absolute"
Property 'Wacom Hover Click' does not exist on device.
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Touch" "off"
Property 'Wacom Hardware Touch Switch' does not exist on device.
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Gesture" "off"
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "ZoomDistance" "0"
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "ScrollDistance" "0"
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "TapTime" "250"
Property 'Wacom Proximity Threshold' does not exist on device.
Property 'Wacom Rotation' does not exist on device.
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "RelWheelUp" "1" "button +5 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "RelWheelDown" "2" "+4 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "AbsWheelUp" "3" "+4 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "AbsWheelDown" "4" "+5 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "AbsWheel2Up" "5" "+4 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "AbsWheel2Down" "6" "+5 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "StripLeftUp" "1" "+4 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "StripLeftDown" "2" "+5 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "StripRightUp" "3" "+4 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "StripRightDown" "4" "+5 "
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Threshold" "0"
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "BindToSerial" "0"
Property 'Wacom Pressure Recalibration' does not exist on device.
如果我们查看相关行
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "8" "+bracketright -bracketright "
您会看到该按钮绑定到单个按键,但是当您查看按钮 12(我之前使用值“key ctrl z”绑定)时:
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "12" "+Control_L +z -z "
您会看到修饰符上只有一个加号。如果我们使用设置输出中的按键标识符和按下命令来使用所需的按键来执行此操作,如下所示:
xsetwacom set "Wacom Cintiq 13HD touch Pad pad" "Button" "8" "key +bracketright "
然后按住按钮将导致按键被按下并保持。
笔记:
您可以传递 xinput id 而不是设备名称。xsetwacom --list devices
将为您提供 ID,但请记住,下次系统启动时该数字可能会有所不同。
echo 命令中的-s
是为了输出 bash 命令以将属性设置为其当前值。如果没有-s
,该命令将为您提供需要放入xorg.conf
文件中的内容,以将属性设置为其当前值,并且显然,按钮绑定不能与该文件一起列出。