Cintiq 22HD on ubuntu

Wacom の液タブ Cintiq 22HD を ubuntu 16.04 に導入する際のメモ。

ubuntu に接続すると難なく画面が表示されペンも反応する。特にドライバをインストールする必要はない。ただし、以下の注意が必要

  1. 本体右上の「i」ボタンとスパナマークのボタンは押しても反応しない
  2. 本体裏のスライドパッドをマウスホイール代わりに使うことはできない(?)
  3. [システム設定] » [グラフィックタブレット] にてボタンに各種キーをアサインできるが…
    • [Ctrl]や[Shift]など特殊キーのみのアサインはできない
    • アプリごとに設定を切り替えることができない

3 が致命的なので xsetwacom コマンドを使って設定を拡張する

コマンドラインから液タブの設定を確認・変更するユーティリティ

デバイスの検知

~$ xsetwacom --list

Wacom Cintiq 22HD Pen stylus    	id: 9	type: STYLUS
Wacom Cintiq 22HD Pad pad       	id: 10	type: PAD
Wacom Cintiq 22HD Pen eraser    	id: 12	type: ERASER

設定の確認

~$ xsetwacom get <デバイス名 or ID> <パラメータ名>

例) xsetwacom get "Wacom Cintiq 22HD Pad pad" Threshold
27

設定の変更

~$ xsetwacom set <デバイス名 or ID> <パラメータ名> <値>

例) xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 12 "key Control_L"

パラメータ一覧

~$ 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.

参考になるサイト » http://azsky2.html.xdomain.jp/note/linux/setwacom.html

結果は以下の通り。4〜7は xsetwacom を使ってもエラーが出る。恐らく電源ボタンと右上の3つのボタンが割り当てられていると推測される。

キー

Linux GUI 環境では、アイコンをダブルクリックすると「デスクトップファイル」が呼び出される。このデスクトップファイルはテキストファイルであり、アイコン・パス・起動コマンド等が記述されている。

  1. 各ソフトごとに設定ファイルを準備
  2. デスクトップファイルから1の設定ファイルを呼び出す

という手法をとれば、アイコンをダブルクリックしてアプリを起動した際に液タブの設定ファイルが読み込まれ、アプリごとに切り替えることができる。

MyPaint

MyPaint.sh
#!/bin/sh
#左ボタン設定
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 2
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 3
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 8 "key Shift_L Control_L Z" #redo
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 9 "key Control_L Z" #undo
 
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 1 "key F12" #表示をリセットして画像を中央に移動
 
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 10
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 11 "key Control_L"
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 12 "key Shift_L"
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 13
 
#右ボタン設定
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 15
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 16
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 17
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 18
 
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 14 "key Control_L S" #save
 
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 19 "key P" #フリーハンド
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 20 "key K" #直線と曲線
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 21 "key J" #連結線
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 22 "key O" #円
 
#起動
mypaint

/usr/share/applications/mypaint.desktop

mypaint.desktop
[Desktop Entry]
Version=1.0
Name=MyPaint
TryExec=mypaint
Exec=$HOME/wacom/MyPaint.sh
Comment=Painting program for digital artists
Comment[ro]=Software de artă plastică digitală
Comment[fr]=Logiciel de peinture numérique pour artistes
Comment[nn_NO]=Måleprogram for digitale artistar
Comment[nb_NO]=Maleprogram for digitale artister
Comment[zh_CN]=艺术家的电脑绘画
Comment[zh_TW]=藝術家的电脑绘画
Comment[zh_HK]=藝術家的电脑绘画
GenericName=Raster Graphics Editor
GenericName[fr]=Éditeur d'Image Matricielle
MimeType=image/openraster;image/png;image/jpeg;
Type=Application
Icon=mypaint
StartupNotify=true
Categories=Graphics;GTK;2DGraphics;RasterGraphics;
Terminal=false

blender(texture paint mode 用)

Blender.sh
#!/bin/sh
#左ボタン設定
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 2 "key Tab"
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 3 "key S" #スポイト
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 8 "key Shift_L Control_L Z" #redo
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 9 "key Control_L Z" #undo
 
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 1 "key Q" #ビューアングル変更
 
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 10 "key F" #ブラシサイズ
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 11 "key Control_L"
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 12 "key Shift_L"
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 13 "key Alt_L"
 
#右ボタン設定
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 15
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 16
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 17
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 18
 
xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 14 "key Control_L S" #save
 
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 19
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 20
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 21
#xsetwacom set "Wacom Cintiq 22HD Pad pad" Button 22
 
#起動
/home/fk0724/blender/blender-2.78a-linux-glibc211-x86_64/blender

/home/fk0724/.local/share/applications/Blender.desktop

Blender.desktop
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Blender
Icon=/home/fk0724/blender/blender-2.78a-linux-glibc211-x86_64/icons/256x256/apps/blender.png
Path=/home/fk0724/blender/blender-2.78a-linux-glibc211-x86_64
Exec=$HOME/wacom/Blender.sh
StartupNotify=false
StartupWMClass=Blender
OnlyShowIn=Unity;
X-UnityGenerated=true

参照 » Ubuntu 16.04 for my digital painting workstation - David Revoy