「ペンタブレット」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(文字列「http://sourceforge.net/」を「https://sourceforge.net/」に置換)
(→‎インストール: 情報を更新)
 
(3人の利用者による、間の14版が非表示)
1行目: 1行目:
 
[[Category:グラフィックタブレット]]
 
[[Category:グラフィックタブレット]]
[[en:Wacom Tablet]]
+
[[en:Graphics tablet]]
  +
{{Related articles start}}
まず、このガイドでは ''USB'' を使う Wacom タブレットを念頭に置いているということを提示しておきます。そのため、ここに書かれている情報は基本的に USB のタブレットに焦点があてられています。通常は [[Xorg]] の自動検出や'''動的な'''設定を使うことが推奨されています。しかしながら''内蔵の''タブレットデバイスでは、自動検出が動作しないために'''固定的な''' Xorg の設定を使うことを考えるかもしれません。固定的な [[Xorg]] の設定は、異なる ''USB'' ポートに Wacom タブレットが接続されたり、同じポートでもタブレットの抜き差しをすると基本的にタブレットを認識できなくなります。従って固定的な設定は推奨されないものだと考えて下さい。
 
  +
{{Related|タブレット PC}}
  +
{{Related articles end}}
   
  +
[[Wikipedia:Graphics tablet]] より:
== インストール ==
 
  +
:グラフィックタブレット(デジタイザー、デジタルグラフィックタブレット、ペンタブレット、描画タブレット、外部描画パッド、デジタルアートボードとも呼ばれる)は、コンピュータの入力デバイスで、特殊なペンのようなスタイラスを使って、鉛筆と紙で画像を描くのと同様の方法で、手描きの画像、アニメーション、グラフィックを作成することができます。
   
  +
ほとんどのグラフィックタブレットは、Arch Linux でそのまま動作します。ボタンのリマップやタブレットのアスペクト比の調整など、特定の追加機能には追加の設定が必要です。この記事では、[[Xorg]] でタブレットを設定する方法を説明します。[[Wayland]] での設定については、[[#Wayland と libinput]] を参照してください。
=== カーネルドライバーが必要かどうか確認する (通常は必要ありません) ===
 
   
  +
== インストール ==
(USB デバイスの場合) タブレットを接続した後 {{ic|lsusb}} や {{ic|<nowiki>dmesg | grep -i wacom</nowiki>}} をチェックしてカーネルがタブレットを認識しているかどうか確認してください。また、タブレットが {{ic|/proc/bus/input/devices}} に記載されているはずです。
 
   
  +
Arch Linux [[カーネル]] には、[https://linuxwacom.github.io linux-wacom] および [https://digimend.github.io DIGImend] プロジェクトによるドライバーが含まれています。linux-wacom は Wacom デバイスをサポートし、DIGImend は他のメーカーのデバイスをサポートします。どちらのプロジェクトも、サポートされているデバイスのリストを公開しています: [https://github.com/linuxwacom/input-wacom/wiki/Device-IDs linux-wacom]、[https://digimend.github.io/tablets/DIGImend] USB または [[Bluetooth]] 経由でタブレットを接続した後、root として {{ic|dmesg}} を実行すると表示され、{{ic|/proc/bus/input/devices}} にリストされます。USB デバイスの場合、{{Pkg|usbutils}} の {{ic|lsusb}} コマンドでもタブレットが表示されます。タブレットが表示されない場合、または特定の機能が動作しない場合は、[[#デバイスがカーネルに認識されない]] を参照してください。
現在のカーネルでサポートされていない新しいデバイスだと認識されないことがあります。カーネルに付属しているドライバーよりも新しいドライバーによってタブレットがサポートされているかもしれません。その場合、[[AUR]] から {{AUR|input-wacom-dkms}} をインストールしてみてください。
 
   
  +
{{Pkg|xf86-input-wacom}} を [[インストール]] します。Xorg ドライバです。Wacom デバイスを接続すると、同梱の {{ic|/usr/share/X11/xorg.conf.d/70-wacom.conf}} ファイルが自動的に {{Man|4|wacom}} ドライバを読み込むので、追加の設定は必要ありません。デバイスが他のメーカーのものである場合、手動で [[Xorg#Configuration|configure]] を行う必要があります。Xorg を ''wacom'' ドライバで使うようにし、''xsetwacom'' を使って設定できるようにします。ここで {{ic|VID:PID}} は {{ic|lsusb}} から見たあなたの USB ID です:
=== Wacom ドライバーのインストール ===
 
   
  +
{{hc|/etc/X11/xorg.conf.d/10-tablet.conf|
[http://linuxwacom.sourceforge.net Linux Wacom Project] のおかげで、Linux で Wacom タブレットを使うために必要なものが全て含まれている {{Pkg|xf86-input-wacom}} パッケージをインストールするだけです。
 
  +
Section "InputClass"
  +
Identifier "Tablet"
  +
Driver "wacom"
  +
MatchDevicePath "/dev/input/event*"
  +
MatchUSBID "''VID:PID''"
  +
EndSection
  +
}}
   
  +
{{Tip|Wacom 以外のいくつかのデバイスをカバーするサンプル設定ファイルは、DIGImend プロジェクトによって提供されています [https://github.com/DIGImend/digimend-kernel-drivers/blob/master/xorg.conf こちら]}}
# pacman -S xf86-input-wacom
 
   
  +
X を再起動した後、{{ic|xsetwacom list devices}} コマンドを実行すると、いくつかのデバイスが一覧表示されるはずです。そうでない場合は、[[#手動設定]] を参照してください。
{{Note|AUR には ''xf86-input-wacom'' の git バージョンである {{AUR|xf86-input-wacom-git}}{{Broken package link|パッケージが存在しません}} があります。ただしこのパッケージを使うとトラブルが発生するかもしれません。例えば、git バージョンではボタンが動作しないことがあります。まずは ''xf86-input-wacom'' を試すことを推奨します。}}
 
   
=== 自動設定 ===
+
=== ユーティリティ ===
   
  +
* {{Pkg|kcm-wacomtablet}} は KDE [[KDE#KCM|構成モジュール]] で、ボタンの再マッピングとタブレットのモニターへのマッピングを可能にします。また、タブレット固有のプロファイルとホットプラグもサポートしています。 ''wacom'' Xorg ドライバーが必要なため、Wayland では動作しません。
新しいバージョンの X は自動でデバイスを検出・設定することができます。先に進む前に、X を再起動して新しい udev ルールを適用してください。次のコマンドを実行して、デバイスがちゃんと認識されているか (ペンと消しゴムが機能するか) テストしてください:
 
  +
* [https://gist.github.com/tom-galvin/6c19fe907945d735c045 mapwacom] は、[[#画面領域幅の縮小]] 方式でアスペクト比を保ったままタブレットをモニターにマッピングすることを自動化するスクリプトです。
  +
* [https://gist.github.com/Konfekt/d57567b84b264e37e62bd5c001e76457 wacom2monitor.sh] は、[[#タブレットをモニタにマッピング]] メソッドを使用してすべての Wacom デバイスをマッピングし、利用可能な出力間のサイクルを可能にするスクリプトです。[[Xbindkeys]] や [[sxhkd]] を使って起動するように設計されています。
   
  +
* {{AUR|ptxconf-git}} はタブレットをモニタにマッピングするための [[GTK]]2 GUIです。タブレットの座標変換行列を ''xinput'' で変更することで動作するので、使用する Xorg ドライバに関係なく動作します (''wacom'' または ''libinput'' のどちらか))
$ xsetwacom --list devices
 
   
  +
=== 代替ドライバー ===
全てのデバイスとタイプが検出されるはずです、例:
 
   
  +
* Bamboo Spark や Bamboo Slate などのワコムのスマートパッドから図面をダウンロードすることができるアプリケーションです。
Wacom Bamboo 2FG 4x5 Pen stylus id: 8 type: STYLUS
 
  +
* {{AUR|huiontablet}} は [https://www.huion.com/ Huion] の公式でプロプライエタリな Linux ドライバです。
Wacom Bamboo 2FG 4x5 Pen eraser id: 9 type: ERASER
 
  +
* {{AUR|xp-pen-tablet}} は、[https://www.xp-pen.com/ XP-Pen] の公式プロプライエタリな Linux ドライバです。
Wacom Bamboo 2FG 4x5 Finger touch id: 13 type: TOUCH
 
  +
* {{AUR|opentabletdriver}} は、いくつかの異なるタブレットモデル用のクロスプラットフォームユーザースペースドライバです。より詳しい情報は [https://opentabletdriver.net/ プロジェクトのウェブサイト] で見ることができます。
Wacom Bamboo 2FG 4x5 Finger pad id: 14 type: PAD
 
   
  +
=== Weylus ===
また、{{Pkg|gimp}} や {{Pkg|xournal}} を開いて拡張入力デバイスのセクションを確認したり、使っているソフトウェアによってサポートされているタブレット関連の機能をテストすることもできます。
 
   
  +
[https://github.com/H-M-H/Weylus Weylus] は、スマートフォンやタブレットをコンピュータ上でグラフィックタブレットとして使用できるようにするプロジェクトです。{{Aur|weylus}} または {{Aur|weylus-bin}} として提供されています。
タブレットを動かすために {{ic|xorg.conf}} ファイルは必要ありません、全ての設定は {{ic|/etc/X11/xorg.conf.d/}} フォルダ下のファイルに作られます。
 
全てが動作するようでしたら手動設定をスキップしてタブレットをカスタマイズする方法を示している設定セクションまで進んで下さい。
 
 
Xorg 1.8 から [[udev|HAL]] のサポートがなくなり代わりに udev が使われるようになったため、タブレットによっては適切な udev ルールがないために自動検出がされてないことがあります。その場合は自分でルールを書く必要があります。
 
 
''xf86-input-wacom'' ドライバーは Xorg サーバーで動作するように設計されているため、Wayland のデスクトップ環境で動作させた場合には問題が発生します (GNOME はデフォルトで Wayland を使用します)。
 
 
=== 手動設定 ===
 
手動設定は {{ic|/etc/X11/xorg.conf}} や {{ic|/etc/X11/xorg.conf.d/}} ディレクトリ下のファイルで行います。
 
Wacom タブレットデバイスにはカーネルドライバーによって提供されている {{ic|/dev/input/}} のインプットイベントインターフェイスを使ってアクセスします。
 
タブレットを同じ、もしくは異なる ''USB'' ポートに抜き差しするとインターフェイス番号 {{ic|event??}} は変化します。
 
そのため。デバイスを参照するときは決まった {{ic|event??}} インターフェイス ('''固定'''設定) を使うのではなく適切な {{ic|event}} ファイルに動的にシンボリックリンクを作成 ('''動的'''設定) するように ''udev'' を設定した方が良いでしょう。
 
 
====udev による動的設定====
 
{{Note|AUR にある wacom-udev パッケージには udev ルールファイルが含まれています。このパッケージを使う場合はこの章をスキップして {{ic|xorg.conf}} の設定に進んでかまいません。}}
 
 
おそらく ''udev'' は既にインストールされていると思うので後は [[Arch User Repository|AUR]] の {{AUR|wacom-udev}}{{Broken package link|{{aur-mirror|wacom-udev}}}} をインストールするだけです。
 
 
=====USB デバイス=====
 
''USB'' タブレットを挿入(もしくは再起動)するとあなたのタブレットデバイスを示すシンボリックリンクが {{ic|/dev/input}} に現れるはずです。
 
 
$ ls /dev/input/wacom*
 
/dev/input/wacom /dev/input/wacom-stylus /dev/input/wacom-touch
 
 
存在しない場合、デバイスが ''wacom-udev'' の ''udev'' 設定 ({{ic|/usr/lib/udev/rules.d/10-wacom.rules}}) にまだ含まれていないことを意味します。ファイルに修正を加える前に {{ic|10-my-wacom.rules}} などにコピーしておいて、パッケージを更新した時も戻せるようにしておくと良いでしょう。
 
 
他のデバイスの行を複製して ''idVendor'',''idProduct'' とシンボリックリンクの名前をあなたの使っているデバイスのものに修正してデバイスをファイルに追加してください。
 
この2つの id は次のコマンドで調べられます:
 
 
$ lsusb | grep -i wacom
 
Bus 002 Device 007: ID 056a:0062 Wacom Co., Ltd
 
 
この例では idVendor は 056a で idProduct は 0062 になります。
 
タッチがあるデバイス (例: Bamboo Pen&Touch) を使っている場合は、タッチ入力インターフェイスの行を追加する必要があるかもしれません。
 
詳細は linuxwacom wiki の [https://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Fixed_device_files_with_udev Fixed device files with udev] をチェックしてください。
 
 
ファイルを保存してコマンド ''udevadm control --reload-rules'' を使って udev の設定プロファイルをリロードしてください。
 
''/dev/input'' の中身を見て ''wacom'' シンボリックリンクが作られていることを確認してください。
 
デバイスを認識させるためにタブレットを挿し直す必要があるかもしれません。
 
 
''Xorg'' の設定のためのファイルは {{ic|/dev/input/wacom}} でタッチデバイスは {{ic|/dev/input/wacom_touch}} です。
 
 
=====シリアルデバイス=====
 
{{AUR|wacom-udev}}{{Broken package link|{{aur-mirror|wacom-udev}}}} にはシリアルデバイスのサポートも含まれています。シリアルタブレットのユーザーは {{Pkg|linuxconsole}} パッケージに入っている inputattach ツールを使うことができます。inputattach コマンドを使うことによってシリアルデバイスを /dev/input ツリーに結びつけることができます、例えば:
 
 
# inputattach --w8001 /dev/ttyS0
 
 
利用可能なオプションについては ''man inputattach'' を見て下さい。
 
USB デバイスなので {{ic|/dev/input/wacom}} ファイルを使います。''Xorg'' の設定に進んで下さい。
 
 
====固定設定====
 
固定設定をする場合は次のセクションの ''Xorg'' 設定のタブレットを参照してください。適切な {{ic|/dev/input/event??}} ファイルを使って下さい。{{ic|/proc/bus/input/devices}} を見ることでわかります。
 
 
====Xorg の設定====
 
 
動的・固定設定どちらの場合でも、{{ic|/dev/input/}} にタブレットの適切な入力イベントデバイスを示すファイルが1つか2つ出来ています。後は関連する情報を {{ic|/etc/X11/xorg.conf}} に追加するか、{{ic|/etc/X11/xorg.conf.d/}} 下の適当なファイルに追加するだけです。
 
実際の設定はあなたの使っているタブレットの機能によります。{{ic|xsetwacom --list devices}} を使うことでタブレットに必要な ''InputDevice'' セクションが何かという役に立つ情報が得られます。
 
 
''Volito2'' の設定例は以下のようになります:
 
 
Section "InputDevice"
 
Driver "wacom"
 
Identifier "stylus"
 
Option "Device" "/dev/input/wacom" # or the corresponding event?? for a static setup
 
Option "Type" "stylus"
 
Option "USB" "on" # USB ONLY
 
Option "Mode" "Relative" # other option: "Absolute"
 
Option "Vendor" "WACOM"
 
Option "tilt" "on" # add this if your tablet supports tilt
 
Option "Threshold" "5" # the official linuxwacom howto advises this line
 
EndSection
 
Section "InputDevice"
 
Driver "wacom"
 
Identifier "eraser"
 
Option "Device" "/dev/input/wacom" # or the corresponding event?? for a static setup
 
Option "Type" "eraser"
 
Option "USB" "on" # USB ONLY
 
Option "Mode" "Relative" # other option: "Absolute"
 
Option "Vendor" "WACOM"
 
Option "tilt" "on" # add this if your tablet supports tilt
 
Option "Threshold" "5" # the official linuxwacom howto advises this line
 
EndSection
 
Section "InputDevice"
 
Driver "wacom"
 
Identifier "cursor"
 
Option "Device" "/dev/input/wacom" # or the corresponding event?? for a static setup
 
Option "Type" "cursor"
 
Option "USB" "on" # USB ONLY
 
Option "Mode" "Relative" # other option: "Absolute"
 
Option "Vendor" "WACOM"
 
EndSection
 
 
パス ({{Ic|"Device"}}) も使っているマウスに変更してください、ここでは {{Ic|/dev/input/mouse_udev}} になります。
 
 
Section "InputDevice"
 
Identifier "Mouse1"
 
Driver "mouse"
 
Option "CorePointer"
 
Option "Device" "/dev/input/mouse_udev"
 
Option "SendCoreEvents" "true"
 
Option "Protocol" "IMPS/2"
 
Option "ZAxisMapping" "4 5"
 
Option "Buttons" "5"
 
EndSection
 
''ServerLayout'' セクションに以下を追加してください:
 
 
InputDevice "cursor" "SendCoreEvents"
 
InputDevice "stylus" "SendCoreEvents"
 
InputDevice "eraser" "SendCoreEvents"
 
最後に ''ServerLayout'' セクションでマウスの識別子を更新してください &ndash; 例えば
 
 
InputDevice "Mouse0" "CorePointer"
 
を次のように変更します
 
 
InputDevice "Mouse1" "CorePointer"
 
   
 
== 設定 ==
 
== 設定 ==
182行目: 80行目:
 
{{Note|
 
{{Note|
 
* タブレットを一旦切断してからもう一度接続することでいつでも一時的な設定をリセットできます。
 
* タブレットを一旦切断してからもう一度接続することでいつでも一時的な設定をリセットできます。
* xsetwacom によって動的にしか設定できないオプションも存在します。そのような場合、デバイスが接続されたときにスクリプトを実行することで xsetwacom を呼び出してデバイスを設定できます。詳しくは [http://unix.stackexchange.com/a/290940/89955] を参照。}}
+
* xsetwacom によって動的にしか設定できないオプションも存在します。そのような場合、デバイスが接続されたときにスクリプトを実行することで xsetwacom を呼び出してデバイスを設定できます。詳しくは [https://unix.stackexchange.com/a/290940/89955] を参照。}}
   
 
==== 永続的な設定 ====
 
==== 永続的な設定 ====
373行目: 271行目:
 
Option "TwinView" "horizontal"
 
Option "TwinView" "horizontal"
   
詳しくは [http://ubuntuforums.org/showthread.php?t=640898 こちら] を参照。
+
詳しくは [https://ubuntuforums.org/showthread.php?t=640898 こちら] を参照。
   
 
===== TwinView の一時的なセットアップ =====
 
===== TwinView の一時的なセットアップ =====
440行目: 338行目:
 
=== kcm-wacomtablet を使う ===
 
=== kcm-wacomtablet を使う ===
   
KDE の設定モジュール {{AUR|kcm-wacomtablet}} (もしくは Plasma 5 を使っている場合、{{AUR|kcm-wacomtablet-frameworks-git}}) を使うことでグラフィカルなユーザーインターフェイスでタブレットの簡単な設定を行うことができます。プロファイルを変更したりホットプラグの適切なサポートができます。タブレットのタイプが自動で検出され、タブレットが接続されたときに自動で設定プロファイルがロードされます。
+
KDE の設定モジュール {{Pkg|kcm-wacomtablet}} (もしくは Plasma 5 を使っている場合、{{AUR|kcm-wacomtablet-frameworks-git}}{{Broken package link|パッケージが存在しません}}) を使うことでグラフィカルなユーザーインターフェイスでタブレットの簡単な設定を行うことができます。プロファイルを変更したりホットプラグの適切なサポートができます。タブレットのタイプが自動で検出され、タブレットが接続されたときに自動で設定プロファイルがロードされます。
   
 
== 特定のアプリケーションの設定 ==
 
== 特定のアプリケーションの設定 ==
485行目: 383行目:
   
 
このプラグインを使うことで [http://sta.sh/muro/ deviantART の Muro] といったオンラインツールを利用することが可能です。プラグインの開発はまだ初期段階なので、上手く動くか保証はできません。
 
このプラグインを使うことで [http://sta.sh/muro/ deviantART の Muro] といったオンラインツールを利用することが可能です。プラグインの開発はまだ初期段階なので、上手く動くか保証はできません。
  +
  +
== Wayland と libinput ==
  +
  +
[[Wayland]] を使用している場合、グラフィックタブレットは [[libinput]] によって処理されます。このシナリオでは、''xsetwacom'' による設定はできません。[[デスクトップ環境]] または Wayland [[Wayland#Compositors|compositor]] で利用可能な設定を通じてのみ、タブレットを設定できます。
  +
  +
* [[GNOME]] は、ボタンの設定とタブレットのモニターへのマッピングを完全にサポートしています。 [https://help.gnome.org/users/gnome-help/stable/wacom.html.en]
  +
* [[KDE Plasma]] は、ボタンの構成とタブレットのモニターへのマッピングを完全にサポートしています。 [https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/677] [https://invent.kde.org/plasma/plasma-desktop/-/merge_requests/1116]
  +
* [[Sway]] は、タブレットのモニターまたは領域へのマッピングのみをサポートします。[[#Sway]] および {{Man|5|sway-input|MAPPING CONFIGURATION}} を参照してください。
  +
  +
{{Tip|
  +
* libinput または Wayland を使用している場合、特定の [[入力リマップユーティリティ]] を使用してタブレットボタンをリマップできます。
  +
* Wayland 環境にタブレットオプションがない場合は、OpenTabletDriver を使用することもできます。[[#代替ドライバー]] を参照してください。}}
  +
  +
=== Sway ===
  +
  +
==== 出力へのマップ ====
  +
  +
これは、[[#タブレットをモニターにマッピングする]] と同じ効果があり、タブレットのアスペクト比が出力と正確に一致しないことを意味します。
  +
  +
次の行を sway 構成ファイルに追加します。
  +
  +
{{hc|~/.config/sway/config|
  +
input ''Identifier'' map_to_output ''Display-Name''
  +
}}
  +
  +
ここで、''Identifier'' は、{{ic|swaymsg -t get_inputs}} によって読み取られるタブレットの識別子です。
  +
  +
{{hc|$ swaymsg -t get_inputs|
  +
Input device: Wacom One by Wacom S Pen
  +
Type: Tablet tool
  +
Identifier: '''1386:890:Wacom_One_by_Wacom_S_Pen'''
  +
Product ID: 890
  +
Vendor ID: 1386
  +
Libinput Send Events: enabled
  +
...
  +
}}
  +
  +
{{Tip|接続するタブレットにこのマッピングを適用する場合は、デバイス識別子の代わりに {{ic|type:tablet_pad}} と {{ic|type:tablet_tool}} を使用します。}}
  +
  +
''Display-Name'' は、{{ic|swaymsg -t get_outputs}} によって読み取られる出力の識別子です。
  +
  +
{{hc|$ swaymsg -t get_outputs|
  +
Output '''HDMI-A-1''' 'Samsung Electric Company ...'
  +
Current mode: 1920x1080 @ 60.000 Hz
  +
Position: 0,0
  +
Scale factor: 1.000000
  +
Scale filter: nearest
  +
...
  +
}}
  +
  +
==== 出力領域へのマップ ====
  +
  +
[[#画面領域の幅を狭くする]] と同じ効果があります。まず、タブレットのアクティブ領域を把握する必要があります。:
  +
  +
{{bc|
  +
# libinput debug-tablet
  +
}}
  +
  +
タブレットのスタイラスを右下隅に移動して最大の ''ABS_X'' および ''ABS_Y'' 値を取得してから、sway 構成に次の行を追加します。
  +
  +
{{hc|~/.config/sway/config|
  +
input ''Identifier'' map_to_region ''X'' ''Y'' ''width'' ''output_height''
  +
}}
  +
  +
''width'' は ''output_height * (ABS_X / ABS_Y)'' で計算され、X と Y は領域の開始座標です。
  +
  +
たとえば、1920x1080 のモニターが 2 台並んでいて、タブレットを右端のモニターの領域にマップする場合は、次の行を使用します。
  +
  +
{{hc|~/.config/sway/config|
  +
input ''Identifier'' map_to_region 1920 0 ''width'' 1080
  +
}}
   
 
==トラブルシューティング==
 
==トラブルシューティング==
   
  +
=== Device not recognized by the kernel ===
新しいタブレットのドライバーはまだカーネルに存在しない可能性があり、特別な設定が必要になります。例えば新しい Intuos タブレット (Draw/Comic/Photo) などがそれにあたります。
 
   
  +
Some tablets may be too recent to be supported by your current kernel. On Wacom devices, this is represented by a "Unknown device_type" message in your ''dmesg'' output. In this scenario, it is possible that the out-of-tree version of the drivers have support for your tablet before it is upstreamed to the kernel.
===Unknown device_type===
 
   
  +
[[Install]] {{AUR|input-wacom-dkms-git}} if you have a Wacom tablet, or {{AUR|digimend-kernel-drivers-dkms-git}} if you have a tablet from another manufacturer.
タブレットが {{ic|xsetwacom}} によって認識されず {{ic|dmesg}} が unknown device_type と吐く場合、input-wacom にパッチを適用したバージョンをインストールする必要があります。
 
   
  +
=== Tablet recognized but xsetwacom and similar tools do not display it ===
[https://sourceforge.net/p/linuxwacom/input-wacom/ci/jiri/for-4.4/~/tarball SourceForge] から 4.4 ブランチをダウンロード・インストールしてください。以下を実行することで、デバイスが認識されるようになります:
 
   
  +
Your logs indicate that the correct driver is selected, and the tablet works. However, when running {{ic|xsetwacom list devices}} or use similar tools that depend on the correct driver, you get an empty list.
# rmmod wacom
 
  +
# insmod /lib/modules/YOUR_KERNEL/extra/wacom.ko.gz
 
  +
A reason might be the execution order of your xorg configuration. {{ic|/usr/share/X11/xorg.conf.d}} gets executed first, then {{ic|/etc/X11/xorg.conf.d}}. The package {{pkg|xf86-input-wacom}} contains the file {{ic|/usr/share/X11/xorg.conf.d/70-wacom.conf}}. If there is a catchall for tablets, executed after this file, the previously selected {{ic|wacom}} driver will be overwritten with a generic one that does not work with xsetwacom et. al.
  +
  +
To make sure, check the rules contained in the files executed after {{ic|/usr/share/X11/xorg.conf.d/70-wacom.conf}} for anything that looks like graphics tablets.
  +
  +
=== Manual setup ===
  +
  +
A manual configuration is done in {{ic|/etc/X11/xorg.conf}} or in a separate file in the {{ic|/etc/X11/xorg.conf.d/}} directory. The Wacom tablet device is accessed using an input event interface in {{ic|/dev/input/}} which is provided by the kernel driver. The interface number {{ic|event??}} is likely to change when unplugging and replugging into the same or especially a different ''USB'' port. Therefore it is wise to not refer to the device using its concrete {{ic|event??}} interface ('''static''' configuration) but by letting ''udev'' dynamically create a symbolic link to the correct {{ic|event}} file ('''dynamic''' configuration).
  +
  +
==== USB-devices ====
  +
  +
After (re-)plugging in your ''USB''-tablet (or at least after rebooting) some symbolic links should appear in {{ic|/dev/input}} referring to your tablet device.
  +
  +
{{hc|$ ls /dev/input/wacom*|
  +
/dev/input/wacom /dev/input/wacom-stylus /dev/input/wacom-touch
  +
}}
  +
  +
If not, your device is likely to be not yet included in the ''udev'' configuration from ''wacom-udev'' which resides in {{ic|/usr/lib/udev/rules.d/wacom.rules}}. Copy the file to {{ic|/etc/udev/rules.d/wacom.rules}} and modify it there.
  +
  +
Add your device to the file by duplicating some line of another device and adapting ''idVendor'',''idProduct'' and the symlink name to your device.
  +
The two id's can be determined using
  +
  +
{{hc|$ lsusb {{!}} grep -i wacom|
  +
Bus 002 Device 007: ID 056a:0062 Wacom Co., Ltd
  +
}}
  +
  +
In this example idVendor is 056a and idProduct 0062. In case you have device with touch (e.g. Bamboo Pen&Touch) you might need to add a second line for the touch input interface. For details check the linuxwacom wiki [https://github.com/linuxwacom/input-wacom/wiki/Fixed-device-files-with-udev Fixed device files with udev].
  +
  +
Save the file and reload udev's configuration profile using the command ''udevadm control --reload-rules'' Check again the content of ''/dev/input'' to make sure that the ''wacom'' symlinks appeared. Note that you may need to plug-in the tablet again for the device to appear.
  +
  +
The files of further interest for the ''Xorg'' configuration are {{ic|/dev/input/wacom}} and for a touch-device also {{ic|/dev/input/wacom_touch}}.
  +
  +
==== Static setup ====
  +
  +
Usually it is recommended to rely on [[Xorg]]'s auto-detection or to use a '''dynamic''' setup. However for an ''internal'' tablet device one might consider a '''static''' Xorg setup in case autodetection does not work. A static [[Xorg]] setup is usually not able to recognize your Wacom tablet when it is connected to a different ''USB'' port or even after unplugging and replugging it into the same port, and as such it should be considered as deprecated.
  +
  +
If you insist in using a static setup just refer to your tablet in the ''Xorg'' configuration in the next section using the correct {{ic|/dev/input/event??}} files as one can find out by looking into {{ic|/proc/bus/input/devices}}.
  +
  +
==== Xorg configuration ====
  +
  +
In either case, dynamic or static setup you got now one or two files in {{ic|/dev/input/}} which refer to the correct input event devices of your tablet. All that is left to do is add the relevant information to {{ic|/etc/X11/xorg.conf}}, or a dedicated file under {{ic|/etc/X11/xorg.conf.d/}}. The exact configuration depends on your tablet's features of course. {{ic|xsetwacom list devices}} might give helpful information on what ''InputDevice'' sections are needed for your tablet.
  +
  +
An example configuration for a ''Volito2'' might look like this
  +
  +
Section "InputDevice"
  +
Driver "wacom"
  +
Identifier "stylus"
  +
Option "Device" "/dev/input/wacom" # or the corresponding event?? for a static setup
  +
Option "Type" "stylus"
  +
Option "USB" "on" # USB ONLY
  +
Option "Mode" "Relative" # other option: "Absolute"
  +
Option "Vendor" "WACOM"
  +
Option "tilt" "on" # add this if your tablet supports tilt
  +
Option "Threshold" "5" # the official linuxwacom howto advises this line
  +
EndSection
  +
Section "InputDevice"
  +
Driver "wacom"
  +
Identifier "eraser"
  +
Option "Device" "/dev/input/wacom" # or the corresponding event?? for a static setup
  +
Option "Type" "eraser"
  +
Option "USB" "on" # USB ONLY
  +
Option "Mode" "Relative" # other option: "Absolute"
  +
Option "Vendor" "WACOM"
  +
Option "tilt" "on" # add this if your tablet supports tilt
  +
Option "Threshold" "5" # the official linuxwacom howto advises this line
  +
EndSection
  +
Section "InputDevice"
  +
Driver "wacom"
  +
Identifier "cursor"
  +
Option "Device" "/dev/input/wacom" # or the corresponding event?? for a static setup
  +
Option "Type" "cursor"
  +
Option "USB" "on" # USB ONLY
  +
Option "Mode" "Relative" # other option: "Absolute"
  +
Option "Vendor" "WACOM"
  +
EndSection
  +
  +
Make sure that you also change the path ({{Ic|"Device"}}) to your mouse, as it will be {{Ic|/dev/input/mouse_udev}} now.
  +
  +
Section "InputDevice"
  +
Identifier "Mouse1"
  +
Driver "mouse"
  +
Option "CorePointer"
  +
Option "Device" "/dev/input/mouse_udev"
  +
Option "SendCoreEvents" "true"
  +
Option "Protocol" "IMPS/2"
  +
Option "ZAxisMapping" "4 5"
  +
Option "Buttons" "5"
  +
EndSection
  +
  +
Add this to the ''ServerLayout'' section
  +
  +
InputDevice "cursor" "SendCoreEvents"
  +
InputDevice "stylus" "SendCoreEvents"
  +
InputDevice "eraser" "SendCoreEvents"
  +
  +
And finally make sure to update the identifier of your mouse in the ''ServerLayout'' section &ndash; as mine went from
  +
  +
InputDevice "Mouse0" "CorePointer"
  +
  +
to
  +
  +
InputDevice "Mouse1" "CorePointer"
  +
  +
=== Mouse moving erratically due to proximity sensor ===
  +
  +
You can disable the mouse jumping due to a proximity sensor detecting a non-existing stylus. You can find your device with {{ic|xinput --list}}, and after spotting the stylus, disable it with:
  +
  +
$ xinput disable ''device''
  +
  +
This only works if you are not currently using a stylus.
  +
  +
=== Touch arbitration not working on graphic tablets ===
  +
  +
If you are using [[libinput]], graphic tablets that have a stylus and a touchscreen might not support [https://who-t.blogspot.com/2019/03/libinput-and-location-based-touch.html touch arbitration] out of the box because the devices are not grouped into the same libinput device group. You can fix this by writing [[udev]] rules. For example, if the touchscreen is recognized with {{ic|0001:000a}} and the Wacom tablet with {{Ic|0002:000b}}, you can create {{ic|/etc/udev/rules.d/80-touch-arbitration.rules}} as a rule that groups these devices into the group {{Ic|f865e87b}}:
  +
  +
{{hc|/etc/udev/rules.d/80-touch-arbitration.rules|2=
  +
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0001", ATTRS{idProduct}=="000a", ENV{LIBINPUT_DEVICE_GROUP}="f865e87b"
  +
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0002", ATTRS{idProduct}=="000b", ENV{LIBINPUT_DEVICE_GROUP}="f865e87b"
  +
}}
   
  +
=== Reporting issues with non-Wacom tablets ===
===システムがフリーズする===
 
   
  +
If you have a non-Wacom tablet that has missing features, you can [https://digimend.github.io/support/howto/trbl/diagnostics/ report a tablet test to DIGImend drivers authors] in order to include its functionalities into the driver. The DIGImend diagnostic tools are available on the AUR as {{AUR|uclogic-tools}}. You will also need the {{ic|lsusb}} and {{ic|usbhid-dump}} programs available in {{Pkg|usbutils}}.
stylus でタブレットを有効にしたときにシステムがフリーズする場合、[https://lkml.org/lkml/2015/11/20/690 LKML] に投稿されているパッチをカーネルに[[ABS でパッチを適用|適用]]してください。
 
   
 
== 参照 ==
 
== 参照 ==
507行目: 594行目:
 
*[http://www.gimptalk.com/forum/topic.php?t=17992&start=1 GIMP Talk - Community - Install Guide: Getting Wacom Drawing Tablets To Work In Gimp]
 
*[http://www.gimptalk.com/forum/topic.php?t=17992&start=1 GIMP Talk - Community - Install Guide: Getting Wacom Drawing Tablets To Work In Gimp]
 
*[https://help.ubuntu.com/community/Wacom Ubuntu Help: Wacom]
 
*[https://help.ubuntu.com/community/Wacom Ubuntu Help: Wacom]
*[http://ubuntuforums.org/showthread.php?t=1038949 Ubuntu Forums - Install a LinuxWacom Kernel Driver for Tablet PC's]
+
*[https://ubuntuforums.org/showthread.php?t=1038949 Ubuntu Forums - Install a LinuxWacom Kernel Driver for Tablet PC's]

2023年4月14日 (金) 23:13時点における最新版

関連記事

Wikipedia:Graphics tablet より:

グラフィックタブレット(デジタイザー、デジタルグラフィックタブレット、ペンタブレット、描画タブレット、外部描画パッド、デジタルアートボードとも呼ばれる)は、コンピュータの入力デバイスで、特殊なペンのようなスタイラスを使って、鉛筆と紙で画像を描くのと同様の方法で、手描きの画像、アニメーション、グラフィックを作成することができます。

ほとんどのグラフィックタブレットは、Arch Linux でそのまま動作します。ボタンのリマップやタブレットのアスペクト比の調整など、特定の追加機能には追加の設定が必要です。この記事では、Xorg でタブレットを設定する方法を説明します。Wayland での設定については、#Wayland と libinput を参照してください。

インストール

Arch Linux カーネル には、linux-wacom および DIGImend プロジェクトによるドライバーが含まれています。linux-wacom は Wacom デバイスをサポートし、DIGImend は他のメーカーのデバイスをサポートします。どちらのプロジェクトも、サポートされているデバイスのリストを公開しています: linux-wacom[1] USB または Bluetooth 経由でタブレットを接続した後、root として dmesg を実行すると表示され、/proc/bus/input/devices にリストされます。USB デバイスの場合、usbutilslsusb コマンドでもタブレットが表示されます。タブレットが表示されない場合、または特定の機能が動作しない場合は、#デバイスがカーネルに認識されない を参照してください。

xf86-input-wacomインストール します。Xorg ドライバです。Wacom デバイスを接続すると、同梱の /usr/share/X11/xorg.conf.d/70-wacom.conf ファイルが自動的に wacom(4) ドライバを読み込むので、追加の設定は必要ありません。デバイスが他のメーカーのものである場合、手動で configure を行う必要があります。Xorg を wacom ドライバで使うようにし、xsetwacom を使って設定できるようにします。ここで VID:PIDlsusb から見たあなたの USB ID です:

/etc/X11/xorg.conf.d/10-tablet.conf
Section "InputClass"
    Identifier "Tablet"
    Driver "wacom"
    MatchDevicePath "/dev/input/event*"
    MatchUSBID "VID:PID"
EndSection
ヒント: Wacom 以外のいくつかのデバイスをカバーするサンプル設定ファイルは、DIGImend プロジェクトによって提供されています こちら

X を再起動した後、xsetwacom list devices コマンドを実行すると、いくつかのデバイスが一覧表示されるはずです。そうでない場合は、#手動設定 を参照してください。

ユーティリティ

  • kcm-wacomtablet は KDE 構成モジュール で、ボタンの再マッピングとタブレットのモニターへのマッピングを可能にします。また、タブレット固有のプロファイルとホットプラグもサポートしています。 wacom Xorg ドライバーが必要なため、Wayland では動作しません。
  • mapwacom は、#画面領域幅の縮小 方式でアスペクト比を保ったままタブレットをモニターにマッピングすることを自動化するスクリプトです。
  • wacom2monitor.sh は、#タブレットをモニタにマッピング メソッドを使用してすべての Wacom デバイスをマッピングし、利用可能な出力間のサイクルを可能にするスクリプトです。Xbindkeyssxhkd を使って起動するように設計されています。
  • ptxconf-gitAUR はタブレットをモニタにマッピングするための GTK2 GUIです。タブレットの座標変換行列を xinput で変更することで動作するので、使用する Xorg ドライバに関係なく動作します (wacom または libinput のどちらか))

代替ドライバー

  • Bamboo Spark や Bamboo Slate などのワコムのスマートパッドから図面をダウンロードすることができるアプリケーションです。
  • huiontabletAURHuion の公式でプロプライエタリな Linux ドライバです。
  • xp-pen-tabletAUR は、XP-Pen の公式プロプライエタリな Linux ドライバです。
  • opentabletdriverAUR は、いくつかの異なるタブレットモデル用のクロスプラットフォームユーザースペースドライバです。より詳しい情報は プロジェクトのウェブサイト で見ることができます。

Weylus

Weylus は、スマートフォンやタブレットをコンピュータ上でグラフィックタブレットとして使用できるようにするプロジェクトです。weylusAUR または weylus-binAUR として提供されています。

設定

全体的な概念

設定方法は2つあり、一時的な設定には xf86-input-wacom に含まれている `xsetwacom` ツールを使い、永続的な設定には xorg.conf もしくは /etc/X11/xorg.conf.d 内のファイルを使います。 利用できるオプションは同じため、まずは `xsetwacom` を使ってテストし、それから最終的な設定を Xorg の設定ファイルに追加するのを推奨します。

一時的な設定

初めにデフォルトの設定と利用できるオプションを全て確認すると良いでしょう。以下のコマンドを使います。

$ xsetwacom --list devices                    # get/set コマンドで利用できるデバイスを一覧します
Wacom Bamboo 16FG 4x5 Finger touch	id: 12	type: TOUCH
Wacom Bamboo 16FG 4x5 Finger pad	id: 13	type: PAD       
Wacom Bamboo 16FG 4x5 Pen stylus	id: 17	type: STYLUS    
Wacom Bamboo 16FG 4x5 Pen eraser	id: 18	type: ERASER
$ xsetwacom --get "Wacom Bamboo 16FG 4x5" all # デバイスの名前を使います
$ xsetwacom --get 17 all                      # もしくはデバイス id を使います
$ xsetwacom --list parameters                 # オプションの説明を表示します
$ man wacom                                   # さらに詳しい説明を表示します
ノート: オプションを設定するシェルスクリプトを書くときにデバイス id を使ってはいけません。ホットプラグで id が変わることがあるからです。

オプションは --set フラグを使って変更できます。例えば:

$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" ScrollDistance 50  # スクロールの速度を変更します
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" Gesture off        # マルチタッチジェスチャーを無効にします
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger touch" Touch off          # タッチを無効にします

詳しい設定については下の #特定の設定のヒント を見て下さい。

ノート:
  • タブレットを一旦切断してからもう一度接続することでいつでも一時的な設定をリセットできます。
  • xsetwacom によって動的にしか設定できないオプションも存在します。そのような場合、デバイスが接続されたときにスクリプトを実行することで xsetwacom を呼び出してデバイスを設定できます。詳しくは [2] を参照。

永続的な設定

Xorg 1.8 以上で永続的な設定をするときは /etc/X11/xorg.conf.d に新しいファイルを作成するのが推奨されています (例: 52-wacom-options.conf)。

/etc/X11/xorg.conf.d/52-wacom-options.conf
Section "InputClass"
    Identifier "Wacom Bamboo stylus options"
    MatchDriver "wacom"
    MatchProduct "Pen"
    
    # Apply custom Options to this device below.
    Option "Rotate" "none"
    Option "RawSample" "20"
    Option "PressCurve" "0,10,90,100"
EndSection

Section "InputClass"
    Identifier "Wacom Bamboo eraser options"
    MatchDriver "wacom"
    MatchProduct "eraser"
    
    # Apply custom Options to this device below.
    Option "Rotate" "none"
    Option "RawSample" "20"
    Option "PressCurve" "5,0,100,95"
EndSection

Section "InputClass"
    Identifier "Wacom Bamboo touch options"
    MatchDriver "wacom"
    MatchProduct "Finger"
    
    # Apply custom Options to this device below.
    Option "Rotate" "none"
    Option "ScrollDistance" "18"
    Option "TapTime" "220"
EndSection

Section "InputClass"
    Identifier "Wacom Bamboo pad options"
    MatchDriver "wacom"
    MatchProduct "pad"
    
    # Apply custom Options to this device below.
    Option "Rotate" "none"
    
    # Setting up buttons
    Option "Button1" "1"
    Option "Button2" "2"
    Option "Button3" "3"
    Option "Button4" "0"
EndSection

identifier は自由に設定することができます。オプションの名前は xsetwacom --list parameters で表示されるものや man wacom で説明されているものと (ボタンを除いて) 同じです。#ボタンの再マッピング で説明しているとおり、ボタンの id は xsetwacom のものと異なるようです。

向きを変更する

タブレットを異なる向きで使いたいときはドライバーに向きの設定をする必要があります。そうしないと動きがおかしなことになってしまいます。 全てのデバイスに Rotate オプションを設定することで向きを変更できます。利用できる方向は none,cw,ccw, half です。 例えば:

$ for i in 12 13 17 18; do xsetwacom --set $i Rotate half; done   # remember the ids might change when hotplugging

もしくは ./wacomrot.sh half のように以下のスクリプトを使って下さい:

wacomrot.sh
#!/bin/bash
device="Wacom Bamboo 16FG 4x5"
stylus="$device Pen stylus"
eraser="$device Pen eraser"
touch="$device Finger touch"
pad="$device Finger pad"

xsetwacom --set "$stylus" Rotate $1
xsetwacom --set "$eraser" Rotate $1
xsetwacom --set "$touch"  Rotate $1
xsetwacom --set "$pad"    Rotate $1

ボタンの再マッピング

ボタンとホットキーのマッピングを変更することが可能です。

ヒント: xsetwacom 用のシンプルなウェブベースの GUI が存在します。現在サポートされているのは bamboo small ですが、他のモデルもサポートされる可能性があります。
ボタン ID を見つけ出す

場合によって適切なボタン ID を見つけるために試行錯誤が必要です。例えばボタン ID が xsetwacomxorg.conf の設定と異なることがあります。そういう場合 xevxbindkeys -mk などのツールがとても役に立ちます。一時的にキーストロークをタブレットのボタンに割り当てるには:

$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 'key a'
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 2 'key b'
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 3 'key c'
$ # and so on

ターミナルウィンドウから xev を立ち上げ、ウィンドウ上にマウスカーソルを移動してボタンを押すと id が書き出されます:

$ xev | grep KeyPress -A 5
構文

xsetwacom の構文は柔軟性がありますが、あまりドキュメントがまとまっていません。xsetwacom 0.17.0 の一般的なマッピングの構文は以下の通りです (ソースコードより)。

KEYWORD [ARGS...] [KEYWORD [ARGS...] ...]

KEYWORD + ARGS:
  key [+,-]KEY [[+,-]KEY ...]  where +:key down, -:key up, no prefix:down and up
  button BUTTON [BUTTON ...]   (1=left,2=middle,3=right mouse button, 4/5 scroll mouse wheel)
  modetoggle                   toggle absolute/relative tablet mode 
  displaytoggle                toggle cursor movement among all displays which include individual screens
                               plus the whole desktop for the selected tool if it is not a pad.
                               When the tool is a pad, the function applies to all tools that are asssociated
                               with the tablet

BUTTON: button ID as integer number

KEY: MODIFIER, SPECIALKEY or ASCIIKEY
MODIFIER: (each can be prefix with an l or an r for the left/right modifier (no prefix = left)
   ctrl=ctl=control, meta, alt, shift, super, hyper
SPECIALKEY: f1-f35, esc=Esc, up,down,left,right, backspace=Backspace, tab, PgUp,PgDn
ASCIIKEY: (usual characters the key produces, e.g. a,b,c,1,2,3 etc.)
サンプル
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 3 # 右マウスボタン
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +ctrl z -ctrl"
$ xsetwacom --get "Wacom Bamboo 16FG 4x5 Finger pad" Button 1
key +Control_L +z -z -Control_L
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +shift button 1 key -shift"

マクロを使うこともできます:

$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key +shift h -shift e l l o"
ノート: xf86-input-wacom ドライバーのバージョン 0.17.0 にはバグが存在し、Wacom Bamboo Pen & Touch などで、キーストロークが正しく上書きされないことがあります:
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key a b c" # press button 1 -> abc
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key d"     # press button 1 -> dbc  WRONG!

マッピングを "" に設定してリセットすることで解決できます:

$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 ""          # to reset the mapping
$ xsetwacom --set "Wacom Bamboo 16FG 4x5 Finger pad" Button 1 "key d"     # press button 1 -> d
ノート: udev ルールから xsetwacom コマンドでスクリプトを実行しても動作しません。この時点では wacom のインプットデバイスの準備ができていないからです。スクリプトの冒頭に sleep 1 を追加することで問題を回避できます。
カスタムコマンドの実行

ボタンにカスタムコマンドをマップするのは少々厄介ですが実際はとてもシンプルです。xbindkeys が必要になるので次のコマンドでインストールしてください:

# pacman -S xbindkeys

ボタンのコードを定義するには、以下を永続的な設定ファイルに追加してください (例: /etc/X11/xorg.conf.d/52-wacom-options.confpad デバイスの InputClass セクション)。タブレットのボタンを使用していないボタンの id にマップします:

# Setting up buttons (preferably choose the correct button order, so the topmost key is mapped to 10 and so on)
Option "Button1" "10"
Option "Button2" "11"
Option "Button3" "12"
Option "Button4" "13"

そして Xorg サーバーを再起動して xevxbindkeys -mk でボタンを確認してください。

それから xbindkeys の設定を行います。デフォルトの設定ファイルが存在しない場合は作成すると良いでしょう:

$ xbindkeys --defaults > ~/.xbindkeysrc

それからカスタムキーマップを ~/.xbindkeysrc に追加してください。例:

"firefox"
    m:0x10 + b:10   (mouse)
"xterm"
    m:0x10 + b:11   (mouse)
"xdotool key ctrl-z"
    m:0x10 + b:12   (mouse)
"send-notify Test "No need for escaping the quotes""
    m:0x10 + b:13   (mouse)

LED

sysfs-driver-wacom ドキュメントを見て下さい。root 権限なしで変更できるようにするには以下のような udev ルールを作成します:

/etc/udev/rules.d/99-wacom.rules
# Give the users group permissions to set Wacom device LEDs.
ACTION=="add", SUBSYSTEM=="hid", DRIVERS=="wacom", RUN+="/usr/bin/sh -c 'chown :users /sys/%p/wacom_led/*'"

Intuos の OLED は AUR の i4oledAUR を使って設定できます。

TwinView セットアップ

2つのモニターでタブレットを使用するとアスペクト比が不自然に感じられることがあります。これを修正するには xorg.conf ファイルの全ての Wacom-InputDevice エントリに以下を追加してください:

Option "TwinView" "horizontal"

詳しくは こちら を参照。

TwinView の一時的なセットアップ

アスペクト比を維持しつつ、一時的に Wacom デバイスをシングルディスプレイにマッピングしたい場合、このスクリプト を使うことができます。ディスプレイ上に入力が引き伸ばされないように、必要に応じてデバイスにレターボックスを設定します。.xinitrc ファイルなどから自動的に実行させることも可能です。

Xrandr の設定

xrandr は2つのモニターを1つの大きな画面として設定するので、仮想スクリーン全体にタブレットをマップするとアスペクト比が変形してしまいます。解決方法は次のスレッドを見て下さい: archlinux forum

タブレットをディスプレイのどちらかにマッピングしたい場合、まずディスプレイの名前を確認してください:

$ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
  1920x1080      60.0*+
  1680x1050      60.0  
  ...
VGA-0 connected 1920x1080+1920+0 (normal left inverted right x axis y axis) 477mm x 268mm
  1920x1080      60.0*+
  1680x1050      60.0  
  ...

そしてタブレットの ID を確認してください:

$ xsetwacom --list devices
WALTOP International Corp. Slim Tablet stylus   id: 12  type: STYLUS

例えばタブレット (ID: 12) を右側のディスプレイ ("VGA-0") にマッピングするには:

$ xsetwacom --set 12 MapToOutput "VGA-0"

上記のコマンドはすぐに適用されます。root は不要です。

xsetwacom が "Unable to find an output ..." と返してくる場合、ディスプレイの識別子のかわりに WIDTHxHEIGHT+X+Y という形式で X11 のジオメトリを指定します。例:

$ xsetwacom --set 12 MapToOutput "1920x1080+1920+0"

上記のコマンドでタブレットが右のディスプレイにマップされるはずです。

もしくは bash スクリプト を使用してタブレットを素早くマッピングしたりアスペクト比を修正することもできます。

筆圧曲線

Wacom Pressure Demo を使って望ましい曲線の P1=red (例: 50,0), P2=purple (例: 100,80), Threshold=green (例: 27) を見つけてください。X 軸はあなたがペンにかける入力圧で、Y 軸はアプリケーションが感知する出力圧です (サンプル曲線)。

以下のコマンドを使うことで、即座に値をデバイスでテストすることができます (例: "Wacom Intuos4 6x9 stylus"):

$ xsetwacom --set "Wacom Intuos4 6x9 stylus" PressureCurve "50" "0" "100" "80"
$ xsetwacom --set "Wacom Intuos4 6x9 stylus" Threshold "27"

満足のいく値が見つかったら以下のように /etc/X11/xorg.conf で適用するか、スタートアップスクリプトで上のシェルコマンドを実行するようにします:

/etc/X11/xorg.conf
Option        "PressCurve"    "50,0,100,80"         # Custom preference
Option        "Threshold"     "27"                  # sensitivity to do a "click"

縦横比を保持

ワイドスクリーンディスプレイ (16:9) で Wacom のタブレットを使用する場合、入力が物理的な縦横比よりも横に長くなってしまうことが問題になります (例えばペンで円を描いてもコンピュータに表示されるのは楕円になります)。ペンタブの縦軸比がモニターと異なるためです。強制的に入力範囲をモニターのアスペクト比にあわせて入力面の下端を取り除くことで問題を解決できます。Windows ドライバーの設定にある "Force Proportions" オプションと同じです。タブレットからの入力をできるだけ正確になぞるために推奨される設定です。

タブレットのデフォルト値を確認するには以下のコマンドを実行 ( "device name or ID" はスタイラスの名前に置き換えてください):

$ xsetwacom --get "device name or ID" Area

値を 11.25 で割ることでタブレットの解像度を弾き出すことができます (例: 21600/11.25=192013500/11.25=1200)。それからディスプレイの解像度である 1920x1080 (16:9) に変換して、1080*11.25=12150 を xsetwacom で新しく設定します:

$ xsetwacom --set "device name or ID" Area 0 0 21600 12150

xorg の設定ファイルでは以下のようにして同じ設定ができます:

Option "BottomX" "21600"
Option "BottomY" "12150"
ノート: 自動的に設定を行う KeepShape オプションも存在しますが、必ずしも機能するとは限りません。

kcm-wacomtablet を使う

KDE の設定モジュール kcm-wacomtablet (もしくは Plasma 5 を使っている場合、kcm-wacomtablet-frameworks-gitAUR[リンク切れ: パッケージが存在しません]) を使うことでグラフィカルなユーザーインターフェイスでタブレットの簡単な設定を行うことができます。プロファイルを変更したりホットプラグの適切なサポートができます。タブレットのタイプが自動で検出され、タブレットが接続されたときに自動で設定プロファイルがロードされます。

特定のアプリケーションの設定

Blender

Blender でパッドのボタンやペンのボタンを有効にするには、xsetwacom のラッパーを作成して、Blender が起動している間だけ一時的にボタンをリマップします。

Sculpt モードに適合させた例 (Bamboo Fun の場合): blender_sculpt.sh

  • 左のタブレットボタンを ShiftControl (pan/tilt/zoom/smooth/invert) にマップ
  • 右のタブレットボタンを F (brush size/strenght)Control-z (undo) にマップ
  • 上のペンのボタンを m (mask control) にマップ

GIMP

GIMP で適切な使用法や、筆圧感知を有効にするには 設定 → 入力デバイス → 追加された入力デバイスの設定... を見て下さい。eraser, stylus, cursor の各デバイスのモードスクリーンに設定して保存してください。

  • GIMP は pad device をサポートしていないので、存在する場合、無効にするようにしてください。もしくは、機能を使いたい場合 Wacom ExpressKeys などのプログラムを使ってキーボードのコマンドにマッピングしてください。
  • stylus で選択されたツールは eraser のツールとは独立していることに注意してください。これはかなり便利に使うことができます。eraser を自由なツールに設定できるからです。

詳しくは GIMP Talk - Community - Install Guide: Getting Wacom Drawing Tablets To Work In GimpSetting up GIMP セクションを参照してください。

上記の設定で不満の場合、xinput create-masterxinput reattach コマンドを使ってタブレットの stylus (と eraser) を2番目のマウスポインタとして設定してみてください。スタイラスペンでタブレットに触っても GIMP で絵を描けない場合に役立ちます。

Inkscape

GIMP と同じように、ファイル → 入力デバイス... を見て下さい。eraser, stylus, cursor の各デバイスのモードスクリーンに設定して保存してください。

Krita

Krita でタブレットを使って絵を描けない場合 (クリックや筆圧が反映されない)、ブラシ選択ダイアログの小さなスクラッチパッドは使えるときは、Krita をフルスクリーンまたはキャンバスオンリーモードにしてみてください。

Krita ではタブレットを使うために Qt を正しく設定する必要があります。タブレットが Krita で動作しない場合、まず Qt でタブレットがちゃんと動作するか確認してください。タブレットの筆圧の効果は painttop 設定で調整することができます。例えば透明度や筆圧、カーブなどを設定できます。

VirtualBox

まず、Arch でタブレットが問題なく動作しているか確認してください。それから、Wacom のウェブサイト からゲスト OS の最新ドライバーをダウンロード・インストールしてください。仮想マシンをシャットダウンして、Settings > USB を開いて下さい。Add Filter From Device を選択してあなたの使っているタブレットを選びます (例: WACOM CTE-440-U V4.0-3 [0403])。Edit Filter を選択して、最後のアイテム RemoteAny に変更してください。

ウェブブラウザのプラグイン

公式の Wacom ウェブプラグインと同じような機能を提供するプラグインが AUR に wacomwebpluginAUR[リンク切れ: アーカイブ: aur-mirror] としてあります。Chromium と Firefox で動くことが確認されています。

このプラグインを使うことで deviantART の Muro といったオンラインツールを利用することが可能です。プラグインの開発はまだ初期段階なので、上手く動くか保証はできません。

Wayland と libinput

Wayland を使用している場合、グラフィックタブレットは libinput によって処理されます。このシナリオでは、xsetwacom による設定はできません。デスクトップ環境 または Wayland compositor で利用可能な設定を通じてのみ、タブレットを設定できます。

  • GNOME は、ボタンの設定とタブレットのモニターへのマッピングを完全にサポートしています。 [3]
  • KDE Plasma は、ボタンの構成とタブレットのモニターへのマッピングを完全にサポートしています。 [4] [5]
  • Sway は、タブレットのモニターまたは領域へのマッピングのみをサポートします。#Sway および sway-input(5) § MAPPING CONFIGURATION を参照してください。
ヒント:
  • libinput または Wayland を使用している場合、特定の 入力リマップユーティリティ を使用してタブレットボタンをリマップできます。
  • Wayland 環境にタブレットオプションがない場合は、OpenTabletDriver を使用することもできます。#代替ドライバー を参照してください。

Sway

出力へのマップ

これは、#タブレットをモニターにマッピングする と同じ効果があり、タブレットのアスペクト比が出力と正確に一致しないことを意味します。

次の行を sway 構成ファイルに追加します。

~/.config/sway/config
input Identifier map_to_output Display-Name

ここで、Identifier は、swaymsg -t get_inputs によって読み取られるタブレットの識別子です。

$ swaymsg -t get_inputs
Input device: Wacom One by Wacom S Pen
 Type: Tablet tool
 Identifier: 1386:890:Wacom_One_by_Wacom_S_Pen
 Product ID: 890
 Vendor ID: 1386
 Libinput Send Events: enabled
 ...
ヒント: 接続するタブレットにこのマッピングを適用する場合は、デバイス識別子の代わりに type:tablet_padtype:tablet_tool を使用します。

Display-Name は、swaymsg -t get_outputs によって読み取られる出力の識別子です。

$ swaymsg -t get_outputs
 Output HDMI-A-1 'Samsung Electric Company ...'
 Current mode: 1920x1080 @ 60.000 Hz
 Position: 0,0
 Scale factor: 1.000000
 Scale filter: nearest
 ...

出力領域へのマップ

#画面領域の幅を狭くする と同じ効果があります。まず、タブレットのアクティブ領域を把握する必要があります。:

# libinput debug-tablet

タブレットのスタイラスを右下隅に移動して最大の ABS_X および ABS_Y 値を取得してから、sway 構成に次の行を追加します。

~/.config/sway/config
input Identifier map_to_region X Y width output_height

widthoutput_height * (ABS_X / ABS_Y) で計算され、X と Y は領域の開始座標です。

たとえば、1920x1080 のモニターが 2 台並んでいて、タブレットを右端のモニターの領域にマップする場合は、次の行を使用します。

~/.config/sway/config
input Identifier map_to_region 1920 0 width 1080

トラブルシューティング

Device not recognized by the kernel

Some tablets may be too recent to be supported by your current kernel. On Wacom devices, this is represented by a "Unknown device_type" message in your dmesg output. In this scenario, it is possible that the out-of-tree version of the drivers have support for your tablet before it is upstreamed to the kernel.

Install input-wacom-dkms-gitAUR if you have a Wacom tablet, or digimend-kernel-drivers-dkms-gitAUR if you have a tablet from another manufacturer.

Tablet recognized but xsetwacom and similar tools do not display it

Your logs indicate that the correct driver is selected, and the tablet works. However, when running xsetwacom list devices or use similar tools that depend on the correct driver, you get an empty list.

A reason might be the execution order of your xorg configuration. /usr/share/X11/xorg.conf.d gets executed first, then /etc/X11/xorg.conf.d. The package xf86-input-wacom contains the file /usr/share/X11/xorg.conf.d/70-wacom.conf. If there is a catchall for tablets, executed after this file, the previously selected wacom driver will be overwritten with a generic one that does not work with xsetwacom et. al.

To make sure, check the rules contained in the files executed after /usr/share/X11/xorg.conf.d/70-wacom.conf for anything that looks like graphics tablets.

Manual setup

A manual configuration is done in /etc/X11/xorg.conf or in a separate file in the /etc/X11/xorg.conf.d/ directory. The Wacom tablet device is accessed using an input event interface in /dev/input/ which is provided by the kernel driver. The interface number event?? is likely to change when unplugging and replugging into the same or especially a different USB port. Therefore it is wise to not refer to the device using its concrete event?? interface (static configuration) but by letting udev dynamically create a symbolic link to the correct event file (dynamic configuration).

USB-devices

After (re-)plugging in your USB-tablet (or at least after rebooting) some symbolic links should appear in /dev/input referring to your tablet device.

$ ls /dev/input/wacom*
/dev/input/wacom  /dev/input/wacom-stylus  /dev/input/wacom-touch

If not, your device is likely to be not yet included in the udev configuration from wacom-udev which resides in /usr/lib/udev/rules.d/wacom.rules. Copy the file to /etc/udev/rules.d/wacom.rules and modify it there.

Add your device to the file by duplicating some line of another device and adapting idVendor,idProduct and the symlink name to your device. The two id's can be determined using

$ lsusb | grep -i wacom
Bus 002 Device 007: ID 056a:0062 Wacom Co., Ltd

In this example idVendor is 056a and idProduct 0062. In case you have device with touch (e.g. Bamboo Pen&Touch) you might need to add a second line for the touch input interface. For details check the linuxwacom wiki Fixed device files with udev.

Save the file and reload udev's configuration profile using the command udevadm control --reload-rules Check again the content of /dev/input to make sure that the wacom symlinks appeared. Note that you may need to plug-in the tablet again for the device to appear.

The files of further interest for the Xorg configuration are /dev/input/wacom and for a touch-device also /dev/input/wacom_touch.

Static setup

Usually it is recommended to rely on Xorg's auto-detection or to use a dynamic setup. However for an internal tablet device one might consider a static Xorg setup in case autodetection does not work. A static Xorg setup is usually not able to recognize your Wacom tablet when it is connected to a different USB port or even after unplugging and replugging it into the same port, and as such it should be considered as deprecated.

If you insist in using a static setup just refer to your tablet in the Xorg configuration in the next section using the correct /dev/input/event?? files as one can find out by looking into /proc/bus/input/devices.

Xorg configuration

In either case, dynamic or static setup you got now one or two files in /dev/input/ which refer to the correct input event devices of your tablet. All that is left to do is add the relevant information to /etc/X11/xorg.conf, or a dedicated file under /etc/X11/xorg.conf.d/. The exact configuration depends on your tablet's features of course. xsetwacom list devices might give helpful information on what InputDevice sections are needed for your tablet.

An example configuration for a Volito2 might look like this

Section "InputDevice"
    Driver        "wacom"
    Identifier    "stylus"
    Option        "Device"       "/dev/input/wacom"   # or the corresponding event?? for a static setup
    Option        "Type"         "stylus"
    Option        "USB"          "on"                 # USB ONLY
    Option        "Mode"         "Relative"           # other option: "Absolute"
    Option        "Vendor"       "WACOM"
    Option        "tilt"         "on"  # add this if your tablet supports tilt
    Option        "Threshold"    "5"   # the official linuxwacom howto advises this line
EndSection
Section "InputDevice"
    Driver        "wacom"
    Identifier    "eraser"
    Option        "Device"       "/dev/input/wacom"   # or the corresponding event?? for a static setup
    Option        "Type"         "eraser"
    Option        "USB"          "on"                  # USB ONLY
    Option        "Mode"         "Relative"            # other option: "Absolute"
    Option        "Vendor"       "WACOM"
    Option        "tilt"         "on"  # add this if your tablet supports tilt
    Option        "Threshold"    "5"   # the official linuxwacom howto advises this line
EndSection
Section "InputDevice"
    Driver        "wacom"
    Identifier    "cursor"
    Option        "Device"       "/dev/input/wacom"   # or the corresponding event?? for a static setup
    Option        "Type"         "cursor"
    Option        "USB"          "on"                  # USB ONLY
    Option        "Mode"         "Relative"            # other option: "Absolute"
    Option        "Vendor"       "WACOM"
EndSection

Make sure that you also change the path ("Device") to your mouse, as it will be /dev/input/mouse_udev now.

Section "InputDevice"
    Identifier  "Mouse1"
    Driver      "mouse"
    Option      "CorePointer"
    Option      "Device"             "/dev/input/mouse_udev"
    Option      "SendCoreEvents"     "true"
    Option      "Protocol"           "IMPS/2"
    Option      "ZAxisMapping"       "4 5"
    Option      "Buttons"            "5"
EndSection

Add this to the ServerLayout section

InputDevice "cursor" "SendCoreEvents" 
InputDevice "stylus" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"

And finally make sure to update the identifier of your mouse in the ServerLayout section – as mine went from

InputDevice    "Mouse0" "CorePointer"

to

InputDevice    "Mouse1" "CorePointer"

Mouse moving erratically due to proximity sensor

You can disable the mouse jumping due to a proximity sensor detecting a non-existing stylus. You can find your device with xinput --list, and after spotting the stylus, disable it with:

$ xinput disable device

This only works if you are not currently using a stylus.

Touch arbitration not working on graphic tablets

If you are using libinput, graphic tablets that have a stylus and a touchscreen might not support touch arbitration out of the box because the devices are not grouped into the same libinput device group. You can fix this by writing udev rules. For example, if the touchscreen is recognized with 0001:000a and the Wacom tablet with 0002:000b, you can create /etc/udev/rules.d/80-touch-arbitration.rules as a rule that groups these devices into the group f865e87b:

/etc/udev/rules.d/80-touch-arbitration.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0001", ATTRS{idProduct}=="000a", ENV{LIBINPUT_DEVICE_GROUP}="f865e87b"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0002", ATTRS{idProduct}=="000b", ENV{LIBINPUT_DEVICE_GROUP}="f865e87b"

Reporting issues with non-Wacom tablets

If you have a non-Wacom tablet that has missing features, you can report a tablet test to DIGImend drivers authors in order to include its functionalities into the driver. The DIGImend diagnostic tools are available on the AUR as uclogic-toolsAUR. You will also need the lsusb and usbhid-dump programs available in usbutils.

参照