Я использую графический планшет "Wacom Intuos" с 4 программируемыми специальными кнопками в соответствии с Ubuntu 18.04. Упомянутый компьютер имеет 2 экрана.
Мне нравится присваивать две кнопки графического планшета к действиям "колесо мыши" и "колесо мыши вниз". Моя Цель состоит в том, чтобы позволить масштабировать без мыши.
Я поэтому определил...
... названия компонентов планшета.
# get a list of the tablet components
xsetwacom --list devices
Wacom Intuos BT S Pad pad id: 12 type: PAD
Wacom Intuos BT S Pen stylus id: 13 type: STYLUS
Wacom Intuos BT S Pen eraser id: 14 type: ERASER
Wacom Intuos BT S Pen cursor id: 15 type: CURSOR
... числовые представления действий мыши.
# Show mouse events
xev -event button
# mouse wheel down
ButtonPress event ... button 4, ...
ButtonRelease event ... button 4, ...
# mouse wheel up
ButtonPress event, ... button 5, ...
ButtonRelease event, ... button 5, ...
Следующая команда должна в моем понимании присваивать "колесо мыши вниз" действие к 3-й кнопке графического планшета. Unfortunetly, который, кажется, не имеет место.
xsetwacom set "Wacom Intuos BT S Pad pad" Button 3 4
# I also tried:
xsetwacom set "Wacom Intuos BT S Pad pad" Button 3 "button 4"
Этот ответ указывает, что численные значения к refere специальные кнопки: 1, 3, 8, 9 (слева направо).
Дело обстоит не так с моей моделью планшета. Button 1
, Button 2
и Button 3
отображаются на первой, второй и третьей кнопке планшета. (По крайней мере, мое тестирование показало это.)
Эта команда является частью сценария удара:
#!/bin/bash
#coding:utf8
main_screen="HEAD-0"
bezier_args="0 20 80 100"
positioning_mode="Absolute"
# Maps the graphics tablet to the area of a specified screen (for multiple-screen environments).
xsetwacom set "Wacom Intuos BT S Pen stylus" MapToOutput "$main_screen"
xsetwacom set "Wacom Intuos BT S Pen eraser" MapToOutput "$main_screen"
# Changes the pressure sensitivity.
xsetwacom set "Wacom Intuos BT S Pen stylus" PressureCurve "$bezier_args"
xsetwacom set "Wacom Intuos BT S Pen eraser" PressureCurve "$bezier_args"
# Specifies the positioning mode ("Absolute" / "Relative")
xsetwacom set "Wacom Intuos BT S Pen stylus" Mode "$positioning_mode"
xsetwacom set "Wacom Intuos BT S Pen eraser" Mode "$positioning_mode"
# Assigns actions to the tablet buttons.
xsetwacom set "Wacom Intuos BT S Pad pad" Button 1 "key +ctrl z -ctrl"
xsetwacom set "Wacom Intuos BT S Pad pad" Button 2 "key +ctrl +shift z -ctrl -shift"
xsetwacom set "Wacom Intuos BT S Pad pad" Button 3 4
exit 0
Кто-либо может сказать мне, что я делаю неправильно?
Я решил использовать +
и -
(от цифровой клавиатуры) вместо mouse wheel up / down
. Те ключи используются многими программами для изменения масштаба без мыши.
# Numpad '+'
xsetwacom set "Wacom Intuos BT S Pad pad" Button 3 "key 0xffab"
# Numpad '-'
xsetwacom set "Wacom Intuos BT S Pad pad" Button 8 "key 0xffad"