Wacom CTH-490 を買ったのでちょっと設定を弄ってみる。CTH-490 だけど、サイズが違うだけの CTH-690 と共通だと思う。Ubuntu と KDE 、Wacom タブレットドライバの環境は下記の通り。
$ lsb_release -a Distributor ID: Ubuntu Description: Ubuntu 17.04 Release: 17.04 Codename: zesty $ kf5-config --version Qt: 5.7.1 KDE Frameworks: 5.31.0 kf5-config: 1.0 $ plasmashell --version plasmashell 5.9.5 $ modinfo wacom filename: /lib/modules/4.10.0-37-generic/kernel/drivers/hid/wacom.ko license: GPL description: USB Wacom tablet driver author: Vojtech Pavlik <vojtech@ucw.cz> version: v2.00 srcversion: 743E49E67E51AC164090406 alias: hid:b0018g0101v0000056Ap* alias: hid:b0003g0101v0000056Ap* alias: hid:b0003g*v000017EFp00006004 alias: hid:b0003g0101v0000056Ap00005002 alias: hid:b0003g0101v0000056Ap00005000 alias: hid:b0003g0101v0000056Ap00004004 alias: hid:b0003g0101v0000056Ap00004001 alias: hid:b0003g0101v0000056Ap00000343 alias: hid:b0003g0101v0000056Ap0000033E alias: hid:b0003g0101v0000056Ap0000033D alias: hid:b0003g0101v0000056Ap0000033C alias: hid:b0003g0101v0000056Ap0000033B alias: hid:b0003g0101v0000056Ap00000336 alias: hid:b0003g0101v0000056Ap00000335 alias: hid:b0003g0101v0000056Ap00000333 alias: hid:b0003g0101v0000056Ap00000331 alias: hid:b0003g0101v0000056Ap0000032F alias: hid:b0003g0101v0000056Ap0000032C alias: hid:b0003g0101v0000056Ap0000032B alias: hid:b0003g0101v0000056Ap0000032A alias: hid:b0003g0101v0000056Ap00000326 alias: hid:b0003g0101v0000056Ap00000325 alias: hid:b0003g0101v0000056Ap00000323 alias: hid:b0003g0101v0000056Ap00000319 alias: hid:b0003g0101v0000056Ap00000318 alias: hid:b0003g0101v0000056Ap00000317 alias: hid:b0003g0101v0000056Ap00000315 alias: hid:b0003g0101v0000056Ap00000314 alias: hid:b0003g0101v0000056Ap0000030E alias: hid:b0003g0101v0000056Ap0000030C alias: hid:b0003g0101v0000056Ap0000030A alias: hid:b0003g0101v0000056Ap00000309 alias: hid:b0003g0101v0000056Ap00000307 alias: hid:b0003g0101v0000056Ap00000304 alias: hid:b0003g0101v0000056Ap00000303 alias: hid:b0003g0101v0000056Ap00000302 alias: hid:b0003g0101v0000056Ap00000301 alias: hid:b0003g0101v0000056Ap00000300 alias: hid:b0003g0101v0000056Ap0000012C alias: hid:b0003g0101v0000056Ap00000116 alias: hid:b0003g0101v0000056Ap0000010F alias: hid:b0003g0101v0000056Ap0000010E alias: hid:b0003g0101v0000056Ap0000010D alias: hid:b0003g0101v0000056Ap00000101 alias: hid:b0003g0101v0000056Ap00000100 alias: hid:b0003g0101v0000056Ap000000FB alias: hid:b0003g0101v0000056Ap000000FA alias: hid:b0003g0101v0000056Ap000000F8 alias: hid:b0003g0101v0000056Ap000000F6 alias: hid:b0003g0101v0000056Ap000000F4 alias: hid:b0003g0101v0000056Ap000000F0 alias: hid:b0003g0101v0000056Ap000000EF alias: hid:b0003g0101v0000056Ap000000ED alias: hid:b0003g0101v0000056Ap000000EC alias: hid:b0003g0101v0000056Ap000000E6 alias: hid:b0003g0101v0000056Ap000000E5 alias: hid:b0003g0101v0000056Ap000000E3 alias: hid:b0003g0101v0000056Ap000000E2 alias: hid:b0003g0101v0000056Ap000000DF alias: hid:b0003g0101v0000056Ap000000DE alias: hid:b0003g0101v0000056Ap000000DD alias: hid:b0003g0101v0000056Ap000000DB alias: hid:b0003g0101v0000056Ap000000DA alias: hid:b0003g0101v0000056Ap000000D8 alias: hid:b0003g0101v0000056Ap000000D7 alias: hid:b0003g0101v0000056Ap000000D6 alias: hid:b0003g0101v0000056Ap000000D5 alias: hid:b0003g0101v0000056Ap000000D4 alias: hid:b0003g0101v0000056Ap000000D3 alias: hid:b0003g0101v0000056Ap000000D2 alias: hid:b0003g0101v0000056Ap000000D1 alias: hid:b0003g0101v0000056Ap000000D0 alias: hid:b0003g0101v0000056Ap000000CE alias: hid:b0003g0101v0000056Ap000000CC alias: hid:b0003g0101v0000056Ap000000C7 alias: hid:b0003g0101v0000056Ap000000C6 alias: hid:b0003g0101v0000056Ap000000C5 alias: hid:b0003g0101v0000056Ap000000C4 alias: hid:b0003g0101v0000056Ap000000C2 alias: hid:b0003g0101v0000056Ap000000C0 alias: hid:b0005g0101v0000056Ap000000BD alias: hid:b0003g0101v0000056Ap000000BC alias: hid:b0003g0101v0000056Ap000000BB alias: hid:b0003g0101v0000056Ap000000BA alias: hid:b0003g0101v0000056Ap000000B9 alias: hid:b0003g0101v0000056Ap000000B8 alias: hid:b0003g0101v0000056Ap000000B7 alias: hid:b0003g0101v0000056Ap000000B5 alias: hid:b0003g0101v0000056Ap000000B4 alias: hid:b0003g0101v0000056Ap000000B3 alias: hid:b0003g0101v0000056Ap000000B2 alias: hid:b0003g0101v0000056Ap000000B1 alias: hid:b0003g0101v0000056Ap000000B0 alias: hid:b0003g0101v0000056Ap0000009F alias: hid:b0003g0101v0000056Ap0000009A alias: hid:b0003g0101v0000056Ap00000097 alias: hid:b0003g0101v0000056Ap00000093 alias: hid:b0003g0101v0000056Ap00000090 alias: hid:b0003g0101v0000056Ap00000084 alias: hid:b0005g0101v0000056Ap00000081 alias: hid:b0003g0101v0000056Ap0000006B alias: hid:b0003g0101v0000056Ap0000006A alias: hid:b0003g0101v0000056Ap00000069 alias: hid:b0003g0101v0000056Ap00000065 alias: hid:b0003g0101v0000056Ap00000064 alias: hid:b0003g0101v0000056Ap00000063 alias: hid:b0003g0101v0000056Ap00000062 alias: hid:b0003g0101v0000056Ap00000061 alias: hid:b0003g0101v0000056Ap00000060 alias: hid:b0003g0101v0000056Ap0000005E alias: hid:b0003g0101v0000056Ap0000005D alias: hid:b0003g0101v0000056Ap0000005B alias: hid:b0003g0101v0000056Ap00000059 alias: hid:b0003g0101v0000056Ap00000057 alias: hid:b0003g0101v0000056Ap00000047 alias: hid:b0003g0101v0000056Ap00000045 alias: hid:b0003g0101v0000056Ap00000044 alias: hid:b0003g0101v0000056Ap00000043 alias: hid:b0003g0101v0000056Ap00000042 alias: hid:b0003g0101v0000056Ap00000041 alias: hid:b0003g0101v0000056Ap0000003F alias: hid:b0003g0101v0000056Ap00000039 alias: hid:b0003g0101v0000056Ap00000038 alias: hid:b0003g0101v0000056Ap00000037 alias: hid:b0003g0101v0000056Ap00000035 alias: hid:b0003g0101v0000056Ap00000034 alias: hid:b0003g0101v0000056Ap00000033 alias: hid:b0003g0101v0000056Ap00000032 alias: hid:b0003g0101v0000056Ap00000031 alias: hid:b0003g0101v0000056Ap00000030 alias: hid:b0003g0101v0000056Ap0000002A alias: hid:b0003g0101v0000056Ap00000029 alias: hid:b0003g0101v0000056Ap00000028 alias: hid:b0003g0101v0000056Ap00000027 alias: hid:b0003g0101v0000056Ap00000026 alias: hid:b0003g0101v0000056Ap00000024 alias: hid:b0003g0101v0000056Ap00000023 alias: hid:b0003g0101v0000056Ap00000022 alias: hid:b0003g0101v0000056Ap00000021 alias: hid:b0003g0101v0000056Ap00000020 alias: hid:b0003g0101v0000056Ap00000019 alias: hid:b0003g0101v0000056Ap00000018 alias: hid:b0003g0101v0000056Ap00000017 alias: hid:b0003g0101v0000056Ap00000016 alias: hid:b0003g0101v0000056Ap00000015 alias: hid:b0003g0101v0000056Ap00000014 alias: hid:b0003g0101v0000056Ap00000013 alias: hid:b0003g0101v0000056Ap00000012 alias: hid:b0003g0101v0000056Ap00000011 alias: hid:b0003g0101v0000056Ap00000010 alias: hid:b0003g0101v0000056Ap00000003 alias: hid:b0003g0101v0000056Ap00000000 depends: hid intree: Y vermagic: 4.10.0-37-generic SMP mod_unload parm: touch_arbitration: on (Y) off (N) (bool)
ワコムタブレットの設定で使うコマンド
xsetwacom
xserver-xorg-input-wacom パッケージに含まれるコマンド。http://linuxwacom.sourceforge.net/wiki/index.php/Xsetwacom に説明がある。いくつかパラメータ名が古い(気がする)。
Usage: xsetwacom [options] [command [arguments...]] Options: -h, --help - usage -v, --verbose - verbose output -V, --version - version info -d, --display "display" - override default display -s, --shell - generate shell commands for 'get' -x, --xconf - generate xorg.conf lines for 'get' Commands: --list devices - display detected devices --list parameters - display supported parameters --list modifiers - display supported modifier and specific keys for keystrokes --set "device name" parameter [values...] - set device parameter by name --get "device name" parameter [param...] - get current device parameter(s) value by name
xinput
xinput パッケージに含まれるコマンド。ワコムタブレットにかかわらず、ノートPCのタッチパットやキーボードなど入力に関するデバイスの制御を行う。
$ xinput --help usage : xinput get-feedbacks <device name> xinput set-ptr-feedback <device name> <threshold> <num> <denom> xinput set-integer-feedback <device name> <feedback id> <value> xinput get-button-map <device name> xinput set-button-map <device name> <map button 1> [<map button 2> [...]] xinput set-pointer <device name> [<x index> <y index>] xinput set-mode <device name> ABSOLUTE|RELATIVE xinput list [--short || --long || --name-only || --id-only] [<device name>...] xinput query-state <device name> xinput test [-proximity] <device name> xinput create-master <id> [<sendCore (dflt:1)>] [<enable (dflt:1)>] xinput remove-master <id> [Floating|AttachToMaster (dflt:Floating)] [<returnPointer>] [<returnKeyboard>] xinput reattach <id> <master> xinput float <id> xinput set-cp <window> <device> xinput test-xi2 [--root] <device> xinput map-to-output <device> <output name> xinput list-props <device> [<device> ...] xinput set-int-prop <device> <property> <format (8, 16, 32)> <val> [<val> ...] xinput set-float-prop <device> <property> <val> [<val> ...] xinput set-atom-prop <device> <property> <val> [<val> ...] xinput watch-props <device> xinput delete-prop <device> <property> xinput set-prop <device> [--type=atom|float|int] [--format=8|16|32] <property> <val> [<val> ...] xinput disable <device> xinput enable <device>
デバイスの検索
CTH-490 はタッチ対応モデルなのでタッチデバイスが出てくる。
$ xsetwacom --list devices Wacom Intuos PT S 2 Pen stylus id: 9 type: STYLUS Wacom Intuos PT S 2 Finger touch id: 10 type: TOUCH Wacom Intuos PT S 2 Pad pad id: 11 type: PAD $ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)] ⎜ ↳ Wacom Intuos PT S 2 Pen stylus id=9 [slave pointer (2)] ⎜ ↳ Wacom Intuos PT S 2 Pad pad id=10 [slave pointer (2)] ⎜ ↳ Wacom Intuos PT S 2 Finger touch id=11 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Power Button id=8 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)] ↳ Panasonic Laptop Support id=14 [slave keyboard (3)]
設定の確認
xsetwacom では --list param
で設定の一覧を確認することができる。ただしこれはドライバが対応しているだけで CTH-490 がすべて対応しているわけではない。
$ xsetwacom --list param Area - Valid tablet area in device coordinates. Button - X11 event to which the given button should be mapped. ToolDebugLevel - Level of debugging trace for individual tools (default is 0 [off]). TabletDebugLevel - Level of debugging statements applied to shared code paths between all tools associated with the same tablet (default is 0 [off]). Suppress - Number of points trimmed (default is 2). RawSample - Number of raw data used to filter the points (default is 4). PressureCurve - Bezier curve for pressure (default is 0 0 100 100 [linear]). Mode - Switches cursor movement mode (default is absolute). TabletPCButton - Turns on/off Tablet PC buttons (default is off for regular tablets, on for Tablet PC). Touch - Turns on/off Touch events (default is on). HWTouchSwitchState - Touch events turned on/off by hardware switch. Gesture - Turns on/off multi-touch gesture events (default is on). ZoomDistance - Minimum distance for a zoom gesture (default is 50). ScrollDistance - Minimum motion before sending a scroll gesture (default is 20). TapTime - Minimum time between taps for a right click (default is 250). CursorProximity - Sets cursor distance for proximity-out in distance from the tablet (default is 10 for Intuos series, 42 for Graphire series). Rotate - Sets the rotation of the tablet. Values = none, cw, ccw, half (default is none). RelWheelUp - X11 event to which relative wheel up should be mapped. RelWheelDown - X11 event to which relative wheel down should be mapped. AbsWheelUp - X11 event to which absolute wheel up should be mapped. AbsWheelDown - X11 event to which absolute wheel down should be mapped. AbsWheel2Up - X11 event to which absolute wheel up should be mapped. AbsWheel2Down - X11 event to which absolute wheel down should be mapped. StripLeftUp - X11 event to which left strip up should be mapped. StripLeftDown - X11 event to which left strip down should be mapped. StripRightUp - X11 event to which right strip up should be mapped. StripRightDown - X11 event to which right strip down should be mapped. Threshold - Sets tip/eraser pressure threshold (default is 27). ResetArea - Resets the bounding coordinates to default in tablet units. ToolType - Returns the tool type of the associated device. ToolSerial - Returns the serial number of the current device in proximity. ToolID - Returns the tool ID of the current tool in proximity. ToolSerialPrevious - Returns the serial number of the previous device in proximity. BindToSerial - Binds this device to the serial number. TabletID - Returns the tablet ID of the associated device. PressureRecalibration - Turns on/off Tablet pressure recalibration MapToOutput - Map the device to the given output. all - Get value for all parameters.
get デバイス名 all
でタブレットの設定値をすべて呼び出す。デバイス名の指定方法は確認した限りでは2種類で、デバイス名とデバイス ID で指定する方法がある。デバイス ID は変わることがあるので注意。
$ xsetwacom --list devices Wacom Intuos PT S 2 Pen stylus id: 9 type: STYLUS Wacom Intuos PT S 2 Finger touch id: 10 type: TOUCH Wacom Intuos PT S 2 Pad pad id: 11 type: PAD $ xsetwacom --get "Wacom Intuos PT S 2 Pen stylus" all # デバイス名で指定する場合 $ xsetwacom --get 9 all # デバイスIDで指定する場合
xsetwacom --list devices
の出力はタブ区切りになっているので grep
と cut
や awk
でデバイス名だけを取り出すことができる。ただし、余計な空白を含んでいるようなので変数などに入れて呼び出したい場合は文字列の後ろにある空白を取り除く処理が必要になる。いくつかサンプルを掲載しておくけどここではシェルのお勉強はしないので方法はお好みで。
$ xsetwacom --list devices | awk -F $'\t' '/type: STYLUS/{ print $1 }' Wacom Intuos PT S 2 Pen stylus ←ここに微妙にスペースが残っている $ echo `xsetwacom --list devices | awk -F $'\t' '/type: STYLUS/{ print $1 }'` # 文字列前後の余計な空白を取り除いてデバイス名を取り出す Wacom Intuos PT S 2 Pen stylus $ xsetwacom --list devices | grep 'type: PAD' | cut -d $'\t' -f2 | grep -o '[0-9]*' # デバイスIDだけ取り出す 11
以降はわかりやすくデバイス名 Wacom Intuos PT S 2 Pen stylus
を使うことにする。
とりあえず all
で全項目を見る。
$ xsetwacom --get "Wacom Intuos PT S 2 Pen stylus" all Button: Actions are not supported by xorg.conf. Try shell format (-s) instead. Button: Actions are not supported by xorg.conf. Try shell format (-s) instead. Button: Actions are not supported by xorg.conf. Try shell format (-s) instead. Property 'Wacom Hardware Touch Switch' does not exist on device. Property 'Wacom Proximity Threshold' does not exist on device. Property 'Wacom Wheel Buttons' does not exist on device. Property 'Wacom Wheel Buttons' does not exist on device. Property 'Wacom Wheel Buttons' does not exist on device. Property 'Wacom Wheel Buttons' does not exist on device. Property 'Wacom Wheel Buttons' does not exist on device. Property 'Wacom Wheel Buttons' does not exist on device. Property 'Wacom Strip Buttons' does not exist on device. Property 'Wacom Strip Buttons' does not exist on device. Property 'Wacom Strip Buttons' does not exist on device. Property 'Wacom Strip Buttons' does not exist on device. Option "Area" "0 0 15200 9500" Option "DebugLevel" "0" Option "CommonDBG" "0" Option "Suppress" "2" Option "RawSample" "4" Option "PressCurve" "0 0 100 100" Option "Mode" "Absolute" Option "TPCButton" "off" Option "Touch" "off" Option "Gesture" "off" Option "ZoomDistance" "0" Option "ScrollDistance" "0" Option "TapTime" "250" Option "Rotate" "none" Option "Threshold" "27" Option "Serial" "0" Option "PressureRecalibration" "on"
いくつかは設定値が存在しないためエラーとなる。これが煩わしければこれらは標準エラー出力に出ているので捨てれば良い。
$ xsetwacom --get "Wacom Intuos PT S 2 stylus" all 2>/dev/null Option "Area" "0 0 15200 9500" Option "DebugLevel" "0" Option "CommonDBG" "0" Option "Suppress" "2" Option "RawSample" "4" Option "PressCurve" "0 0 100 100" Option "Mode" "Absolute" Option "TPCButton" "off" Option "Touch" "off" Option "Gesture" "off" Option "ZoomDistance" "0" Option "ScrollDistance" "0" Option "TapTime" "250" Option "Rotate" "none" Option "Threshold" "27" Option "Serial" "0" Option "PressureRecalibration" "on"
見てみると Option "Mode" "Absolute"
があるので、マウスのように相対位置でカーソルを動かすこともできるようだ。(やってみたが恐らく Area
も弄らないととんでもない移動量になる)
Threshold
はしきい値だが、どれくらいの筆圧から検知するかの設定だと思う。デフォルトは 27
だけど 1
にすれば弱く書いても反応するし、1024
に設定すれば筆圧を強くしないと書けない。
PressCurve
は筆圧カーブだと思う。設定に関する情報は Wacom タブレット - ArchWiki に書いてある。また、Xsetwacom - linuxwacom には下記のような説明がある。
0 100 0 100 # ridiculously soft 0 50 50 100 # very soft 0 0 100 100 # linear, the default 50 0 100 50 # very firm 100 0 100 0 # unbelievably firm
PressCurve
は現在、PressureCurve
に変わっていたりする。新しい名称は Xsetwacom - linuxwacom に書かれている。
xinput でも同様に設定値の確認ができる。こちらもデバイス名またはデバイス ID を使用することができる。設定値の隣にある ()
内の数値はデフォルト値などではなく、設定 ID のようだ。
$ xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ SynPS/2 Synaptics TouchPad id=13 [slave pointer (2)] ⎜ ↳ Wacom Intuos PT S 2 Pen stylus id=9 [slave pointer (2)] ⎜ ↳ Wacom Intuos PT S 2 Pad pad id=10 [slave pointer (2)] ⎜ ↳ Wacom Intuos PT S 2 Finger touch id=11 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ Video Bus id=7 [slave keyboard (3)] ↳ Power Button id=8 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=12 [slave keyboard (3)] ↳ Panasonic Laptop Support id=14 [slave keyboard (3)] $ xinput list-props 'Wacom Intuos PT S 2 Pen stylus' Device 'Wacom Intuos PT S 2 Pen stylus': Device Enabled (139): 1 Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 Device Accel Profile (268): 0 Device Accel Constant Deceleration (269): 1.000000 Device Accel Adaptive Deceleration (270): 1.000000 Device Accel Velocity Scaling (271): 10.000000 Device Node (265): "/dev/input/event4" Wacom Tablet Area (278): 0, 0, 15200, 9500 Wacom Rotation (279): 0 Wacom Pressurecurve (280): 0, 0, 100, 100 Wacom Serial IDs (281): 828, 2021887582, 2274, 0, 0 Wacom Serial ID binding (282): 0 Wacom Pressure Threshold (283): 27 Wacom Sample and Suppress (284): 2, 4 Wacom Enable Touch (285): 0 Wacom Hover Click (286): 1 Wacom Enable Touch Gesture (287): 0 Wacom Touch Gesture Parameters (288): 0, 0, 250 Wacom Tool Type (289): "STYLUS" (267) Wacom Button Actions (290): "Wacom button action 0" (291), "Wacom button action 1" (292), "Wacom button action 2" (293) Wacom button action 0 (291): 1572865 Wacom button action 1 (292): 1572866 Wacom button action 2 (293): 1572867 Wacom Pressure Recalibration (294): 1 Device Product ID (266): 1386, 828 Wacom Debug Levels (295): 0, 0 $ xinput list-props 9 Device 'Wacom Intuos PT S 2 Pen stylus': Device Enabled (139): 1 Coordinate Transformation Matrix (141): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 Device Accel Profile (268): 0 Device Accel Constant Deceleration (269): 1.000000 Device Accel Adaptive Deceleration (270): 1.000000 Device Accel Velocity Scaling (271): 10.000000 Device Node (265): "/dev/input/event4" Wacom Tablet Area (278): 0, 0, 15200, 9500 Wacom Rotation (279): 0 Wacom Pressurecurve (280): 0, 0, 100, 100 Wacom Serial IDs (281): 828, 2021887582, 2274, 0, 0 Wacom Serial ID binding (282): 0 Wacom Pressure Threshold (283): 27 Wacom Sample and Suppress (284): 2, 4 Wacom Enable Touch (285): 0 Wacom Hover Click (286): 1 Wacom Enable Touch Gesture (287): 0 Wacom Touch Gesture Parameters (288): 0, 0, 250 Wacom Tool Type (289): "STYLUS" (267) Wacom Button Actions (290): "Wacom button action 0" (291), "Wacom button action 1" (292), "Wacom button action 2" (293) Wacom button action 0 (291): 1572865 Wacom button action 1 (292): 1572866 Wacom button action 2 (293): 1572867 Wacom Pressure Recalibration (294): 1 Device Product ID (266): 1386, 828 Wacom Debug Levels (295): 0, 0
こちらもデバイス名またはデバイス ID で指定することができる。設定値の方も ID が使用可能。
$ xinput set-prop 'Wacom Intuos PT S 2 Pen stylus' 'Wacom Pressure Threshold' 1 $ xinput set-prop 9 283 1
watch-props
では設定値のモニタリングができるので設定が変更されたときに変更点を随時表示してくれる。
$ xinput watch-props 9
設定の自動反映
※ここからは検証中
xsetwacom
で設定した内容はタブレットを接続し直すと元に戻ってしまうので udev でコントロールする。が、xsetwacom
も xinput
もデバイスが接続されたあとでなければ意味が無いのでどうしようかな、と。(スリープ?いや、なんかダサい…)
とりあえず udev か xorg.conf で設定することになると思うが、とりあえずデバイス ID を調べる…。
$ lsusb Bus 002 Device 046: ID 056a:033c Wacom Co., Ltd Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
CTH-490 はベンダー ID 056a
、製品 ID 033c
のようだ。が、
$ udevadm info -p `udevadm -nva idProduct=033c` P: /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 N: bus/usb/002/046 E: BUSNUM=002 E: DEVNAME=/dev/bus/usb/002/046 E: DEVNUM=046 E: DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2 E: DEVTYPE=usb_device E: DRIVER=usb E: ID_BUS=usb E: ID_MODEL=Intuos_PTS E: ID_MODEL_ENC=Intuos\x20PTS E: ID_MODEL_ID=033c E: ID_REVISION=0100 E: ID_SERIAL=Wacom_Co._Ltd._Intuos_PTS E: ID_USB_INTERFACES=:030000:030102: E: ID_VENDOR=Wacom_Co._Ltd. E: ID_VENDOR_ENC=Wacom\x20Co.\x2cLtd. E: ID_VENDOR_FROM_DATABASE=Wacom Co., Ltd E: ID_VENDOR_ID=056a E: MAJOR=189 E: MINOR=173 E: PRODUCT=56a/33c/100 E: SUBSYSTEM=usb E: TYPE=0/0/0 E: USEC_INITIALIZED=12674327735
と、やってみたが SUBSYSTEM=usb
じゃなくて SUBSYSTEM=input
なんだよな…。/dev/input
以下を見ると色々あるが、どれがスタイラスとかパッドかわからない。
$ ls /dev/input by-id by-path event0 event1 event10 event11 event12 event2 event3 event4 event5 event6 event7 event8 event9 js0 mice mouse0 mouse1 mouse2 mouse3
xinput の Device Node を見てみるとスタイラスはいまのところ /dev/input/event4
のようだ。(接続したタイミングで変わるので注意)
$ xinput list-props 9 | grep Node Device Node (265): "/dev/input/event4"
んで /dev/input/event4
を udevadm で見てみる。
$ udevadm info -a $(eval echo $(xinput list-props 9 | grep Node | cut -f 3)) Udevadm info starts with the device specified by the devpath and then walks up the chain of parent devices. It prints for every device found, all possible attributes in the udev rules key format. A rule to match, can be composed by the attributes of the device and the attributes from one single parent device. looking at device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:056A:033C.0082/input/input275/event4': KERNEL=="event4" SUBSYSTEM=="input" DRIVER=="" looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:056A:033C.0082/input/input275': KERNELS=="input275" SUBSYSTEMS=="input" DRIVERS=="" ATTRS{name}=="Wacom Intuos PT S 2 Pen" ATTRS{phys}=="usb-0000:00:1d.0-1.2/input0" ATTRS{properties}=="1" ATTRS{uniq}=="" looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:056A:033C.0082': KERNELS=="0003:056A:033C.0082" SUBSYSTEMS=="hid" DRIVERS=="wacom" ATTRS{country}=="00" looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0': KERNELS=="2-1.2:1.0" SUBSYSTEMS=="usb" DRIVERS=="usbhid" ATTRS{authorized}=="1" ATTRS{bAlternateSetting}==" 0" ATTRS{bInterfaceClass}=="03" ATTRS{bInterfaceNumber}=="00" ATTRS{bInterfaceProtocol}=="00" ATTRS{bInterfaceSubClass}=="00" ATTRS{bNumEndpoints}=="01" ATTRS{supports_autosuspend}=="1" looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2': KERNELS=="2-1.2" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{authorized}=="1" ATTRS{avoid_reset_quirk}=="0" ATTRS{bConfigurationValue}=="1" ATTRS{bDeviceClass}=="00" ATTRS{bDeviceProtocol}=="00" ATTRS{bDeviceSubClass}=="00" ATTRS{bMaxPacketSize0}=="64" ATTRS{bMaxPower}=="498mA" ATTRS{bNumConfigurations}=="1" ATTRS{bNumInterfaces}==" 3" ATTRS{bcdDevice}=="0100" ATTRS{bmAttributes}=="80" ATTRS{busnum}=="2" ATTRS{configuration}=="" ATTRS{devnum}=="46" ATTRS{devpath}=="1.2" ATTRS{idProduct}=="033c" ATTRS{idVendor}=="056a" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Wacom Co.,Ltd." ATTRS{maxchild}=="0" ATTRS{product}=="Intuos PTS" ATTRS{quirks}=="0x0" ATTRS{removable}=="removable" ATTRS{speed}=="12" ATTRS{urbnum}=="366249" ATTRS{version}==" 2.00" looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1': KERNELS=="2-1" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{authorized}=="1" ATTRS{avoid_reset_quirk}=="0" ATTRS{bConfigurationValue}=="1" ATTRS{bDeviceClass}=="09" ATTRS{bDeviceProtocol}=="01" ATTRS{bDeviceSubClass}=="00" ATTRS{bMaxPacketSize0}=="64" ATTRS{bMaxPower}=="0mA" ATTRS{bNumConfigurations}=="1" ATTRS{bNumInterfaces}==" 1" ATTRS{bcdDevice}=="0000" ATTRS{bmAttributes}=="e0" ATTRS{busnum}=="2" ATTRS{configuration}=="" ATTRS{devnum}=="2" ATTRS{devpath}=="1" ATTRS{idProduct}=="0024" ATTRS{idVendor}=="8087" ATTRS{ltm_capable}=="no" ATTRS{maxchild}=="8" ATTRS{quirks}=="0x0" ATTRS{removable}=="fixed" ATTRS{speed}=="480" ATTRS{urbnum}=="1238" ATTRS{version}==" 2.00" looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2': KERNELS=="usb2" SUBSYSTEMS=="usb" DRIVERS=="usb" ATTRS{authorized}=="1" ATTRS{authorized_default}=="1" ATTRS{avoid_reset_quirk}=="0" ATTRS{bConfigurationValue}=="1" ATTRS{bDeviceClass}=="09" ATTRS{bDeviceProtocol}=="00" ATTRS{bDeviceSubClass}=="00" ATTRS{bMaxPacketSize0}=="64" ATTRS{bMaxPower}=="0mA" ATTRS{bNumConfigurations}=="1" ATTRS{bNumInterfaces}==" 1" ATTRS{bcdDevice}=="0410" ATTRS{bmAttributes}=="e0" ATTRS{busnum}=="2" ATTRS{configuration}=="" ATTRS{devnum}=="1" ATTRS{devpath}=="0" ATTRS{idProduct}=="0002" ATTRS{idVendor}=="1d6b" ATTRS{interface_authorized_default}=="1" ATTRS{ltm_capable}=="no" ATTRS{manufacturer}=="Linux 4.10.0-38-generic ehci_hcd" ATTRS{maxchild}=="3" ATTRS{product}=="EHCI Host Controller" ATTRS{quirks}=="0x0" ATTRS{removable}=="unknown" ATTRS{serial}=="0000:00:1d.0" ATTRS{speed}=="480" ATTRS{urbnum}=="494" ATTRS{version}==" 2.00" looking at parent device '/devices/pci0000:00/0000:00:1d.0': KERNELS=="0000:00:1d.0" SUBSYSTEMS=="pci" DRIVERS=="ehci-pci" ATTRS{broken_parity_status}=="0" ATTRS{class}=="0x0c0320" ATTRS{companion}=="" ATTRS{consistent_dma_mask_bits}=="32" ATTRS{d3cold_allowed}=="1" ATTRS{device}=="0x1c26" ATTRS{dma_mask_bits}=="32" ATTRS{driver_override}=="(null)" ATTRS{enable}=="1" ATTRS{irq}=="23" ATTRS{local_cpulist}=="0-3" ATTRS{local_cpus}=="000f" ATTRS{msi_bus}=="1" ATTRS{numa_node}=="-1" ATTRS{revision}=="0x04" ATTRS{subsystem_device}=="0x8338" ATTRS{subsystem_vendor}=="0x10f7" ATTRS{uframe_periodic_max}=="100" ATTRS{vendor}=="0x8086" looking at parent device '/devices/pci0000:00': KERNELS=="pci0000:00" SUBSYSTEMS=="" DRIVERS==""
適当に /etc/udev/rules.d/90-wacom.rules
を作る。
ACTION=="add", SUBSYSTEMS=="input", ATTRS{name}=="Wacom Intuos PT S 2 Pen", RUN+="/usr/bin/env XAUTHORITY=/home/me/.Xauthority DISPLAY=:0 /usr/bin/xsetwacom set 'Wacom Intuos PT S 2 Pen stylus' Threashold 1"
$ udevadm test --action=add `udevadm trigger -nva name="Wacom Intuos PT S 2 Pen"` calling: test version 232 === trie on-disk === tool version: 232 file size: 8801854 bytes header size 80 bytes strings 1856302 bytes nodes 6945472 bytes : 中略 : Reading rules file: /etc/udev/rules.d/99-wacom.rules RUN '/usr/bin/env XAUTHORITY=/home/me/.Xauthority DISPLAY=:0 /usr/bin/xsetwacom set 'Wacom Intuos PT S 2 Pen stylus' Threashold 1' /etc/udev/rules.d/99-wacom.rules:5 Unload module index Unloaded link configuration context. This program is for debugging only, it does not run any program specified by a RUN key. It may show incorrect results, because some values may be different, or not available at a simulation run. .INPUT_CLASS=mouse .MM_USBIFNUM=00 ABS=10003000003 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:056A:033C.0082/input/input275 EV=1b ID_BUS=usb ID_FOR_SEAT=input-pci-0000_00_1d_0-usb-0_1_2_1_0 ID_INPUT=1 ID_INPUT_TABLET=1 ID_MODEL=Intuos_PTS ID_MODEL_ENC=Intuos\x20PTS ID_MODEL_ID=033c ID_PATH=pci-0000:00:1d.0-usb-0:1.2:1.0 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_2_1_0 ID_REVISION=0100 ID_SERIAL=Wacom_Co._Ltd._Intuos_PTS ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030000:030102: ID_USB_INTERFACE_NUM=00 ID_VENDOR=Wacom_Co._Ltd. ID_VENDOR_ENC=Wacom\x20Co.\x2cLtd. ID_VENDOR_ID=056a KEY=1c01 0 0 0 0 0 MODALIAS=input:b0003v056Ap033Ce0110-e0,1,3,4,k140,14A,14B,14C,ra0,1,18,19,28,m0,lsfw MSC=1 NAME="Wacom Intuos PT S 2 Pen" PHYS="usb-0000:00:1d.0-1.2/input0" PRODUCT=3/56a/33c/110 PROP=1 SUBSYSTEM=input TAGS=:seat: UNIQ="" USEC_INITIALIZED=12674348315 run: 'kmod load input:b0003v056Ap033Ce0110-e0,1,3,4,k140,14A,14B,14C,ra0,1,18,19,28,m0,lsfw' run: '/usr/bin/env XAUTHORITY=/home/me/.Xauthority DISPLAY=:0 /usr/bin/xsetwacom set 'Wacom Intuos PT S 2 Pen stylus' Threashold 1'
udevadm のテストでは RUN+=
に設定したコマンドが走るようだけど、これじゃ設定されないのよね。sleep
挟んだところでこのコマンド終わらないとデバイス認識されないだろうし…。
一応、udevadm monitor --env
で監視したときのスタイラスの情報を残しておく。
UDEV [76906.924294] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:056A:033C.0085/input/input281 (input) .INPUT_CLASS=mouse .MM_USBIFNUM=00 ABS=10003000003 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/0003:056A:033C.0085/input/input281 EV=1b ID_BUS=usb ID_FOR_SEAT=input-pci-0000_00_1d_0-usb-0_1_2_1_0 ID_INPUT=1 ID_INPUT_TABLET=1 ID_MODEL=Intuos_PTS ID_MODEL_ENC=Intuos\x20PTS ID_MODEL_ID=033c ID_PATH=pci-0000:00:1d.0-usb-0:1.2:1.0 ID_PATH_TAG=pci-0000_00_1d_0-usb-0_1_2_1_0 ID_REVISION=0100 ID_SERIAL=Wacom_Co._Ltd._Intuos_PTS ID_TYPE=hid ID_USB_DRIVER=usbhid ID_USB_INTERFACES=:030000:030102: ID_USB_INTERFACE_NUM=00 ID_VENDOR=Wacom_Co._Ltd. ID_VENDOR_ENC=Wacom\x20Co.\x2cLtd. ID_VENDOR_ID=056a KEY=1c01 0 0 0 0 0 MODALIAS=input:b0003v056Ap033Ce0110-e0,1,3,4,k140,14A,14B,14C,ra0,1,18,19,28,m0,lsfw MSC=1 NAME="Wacom Intuos PT S 2 Pen" PHYS="usb-0000:00:1d.0-1.2/input0" PRODUCT=3/56a/33c/110 PROP=1 SEQNUM=7299 SUBSYSTEM=input TAGS=:seat: UNIQ="" USEC_INITIALIZED=76906917653
あとは xorg.conf を使う方法。これまた /usr/share/X11/xorg.conf/90-wacom.conf
とかいう適当なものを作る。これも効くかどうかはわからん。
Section "InputClass" Identifier "Wacom CTH-490" MatchUSBID "056a:033c" Option "Wacom Pressure Threshold" "1" EndSection
とりあえず時間なくて色々試す暇が無いので KDE 環境のスタートアップを使うことにして、.config/autostart-scripts/wacom.sh
を作ってログイン時に実行するようにしておいた。
#!/bin/sh /usr/bin/xsetwacom set "Wacom Intuos PT S 2 Pen stylus" Threshold 1