old-www/HOWTO/Wacom-Tablet-HOWTO-6.html

275 lines
9.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
<META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
<TITLE> Wacom Tablet HOWTO: Changing configuration from within a running X-Server</TITLE>
<LINK HREF="Wacom-Tablet-HOWTO-7.html" REL=next>
<LINK HREF="Wacom-Tablet-HOWTO-5.html" REL=previous>
<LINK HREF="Wacom-Tablet-HOWTO.html#toc6" REL=contents>
</HEAD>
<BODY>
<A HREF="Wacom-Tablet-HOWTO-7.html">Next</A>
<A HREF="Wacom-Tablet-HOWTO-5.html">Previous</A>
<A HREF="Wacom-Tablet-HOWTO.html#toc6">Contents</A>
<HR>
<H2><A NAME="s6">6. Changing configuration from within a running X-Server</A></H2>
<P>
<P>
<A NAME="_Toc465765721"></A> <H2><A NAME="ss6.1">6.1 Setting up the Gimp to use XInput devices</A>
</H2>
<P>
<P>
<A NAME="_Toc465765722"></A>
<A HREF="Wacom-Tablet-HOWTO-3.html#_gimp">Gimp</A>
has built-in XInput support since Version 1.1.x.
<P>Gimp must know which devices it should use and in what mode. You have to open
the
<EM>File/Dialogs/Input Devices</EM>
- dialog for setting this up. You will find two listbox-controls at the top of
that window labeled
<EM>Device</EM>
and
<EM>Mode</EM>
. Choose the device to set up from the
<EM>Device</EM>
control and choose a mode from the
<EM>Mode</EM>
-control.
<P>The modes are:
<P>
<UL>
<LI>disabled: Gimp does not use this device.</LI>
<LI>window: <BR>
Gimp uses this device, the cursor is drawn by the application. The cursor can not leave the active window.
The active area of the tablet is mapped to this window.</LI>
<LI>screen:<BR>
Gimp uses this device. The cursor is drawn by the X-Server. The cursor can move over the whole screen.
The active area of the tablet is mapped to the screen.</LI>
</UL>
<P>
<P>If you see two cursors linked to your device, you have two solutions:
<UL>
<LI>Use mode screen but you may or may not loose the special gimp-tool cursors; If
so, all cursors will be replaced by the pen cursor.</LI>
<LI>Configure two different devices in the XF86Config file, one
<EM>AlwaysCore</EM>
and one not. Tell gimp to use the later one in mode window. If you do so and
have one of the statements
<EM>TopX, TopY, BottomX, BottomY</EM>
in your XF86Config, take care to use the same adjustments for that statements in
both logical devices. If you do not, then you get confused because X draws a
cursor of the one device while the other is active. the effect of this is a
cursor, very far away from the point of action (hotspot).</LI>
</UL>
<P>
<P>Below the two listbox-controls there is a tab-control with the two register
tabs
<EM>Axes</EM>
and
<EM>Keys</EM>
.
<EM>Axes</EM>
assigns an axis a function, it is mostly not necessary to change this. But
think about a touch-screen device which is built in a table rotated by 90
degrees, then you might want to swap the x and y axis.
<P>
<P>Some tablets have so called macro keys at the top which may hold some often used functions. The
<A NAME="_macrokeys"></A>
<EM>Keys</EM>
tab lets you assign a character to a macro key. For example, you can put Ctrl+Shift+R, to a macro key. If you
activate this key, then the rulers are toggled. <BR>
The current Wacom driver supports only the macro keys of the ultrapad series,
the macro area of the intuos products is not yet usable for that.
<P>
<P>Now we should talk about how the devices can be used. Open the
<EM>File/Dialogs/Device Status</EM>
-dialog. Open an image.
<P>You set up each device independently from each other in gimp.
<P>If you move the cursor with different devices in the image window you can see
the devices change in the Device Status dialog. If you pick a tool, brush,
pattern or color with a device, again the changes are reflected in the dialog.
You can save the settings in the Status Dialog, so that they will be restored
before your next session.
<P>
<P>
<H2><A NAME="ss6.2">6.2 The Switch Device</A>
</H2>
<P>
<P>
<A NAME="_Toc465765723"></A>
This is a special device that is always present. It generates an event every
time a new device becomes the core pointer. It has a pseudo &quot;axis&quot;.
The &quot;value&quot; of this axis is the id of the core pointer device. I do
not know what a user can do with it - this is mainly helpful for internal use.
<P>
<H2><A NAME="ss6.3">6.3 Buttons</A>
</H2>
<P>
<P>
<A NAME="_Toc465765724"></A>
The buttons of the devices are as different as the devices are:<BR>
A pen has at least a tip, but it may have one or two side switches and an
eraser. A mouse may have up to 32 buttons (but usually 3). Buttons are numbered
from 1 to the number of buttons. With the next two utilities you can change, to
what number a button is mapped.
<P>
<H2><A NAME="ss6.4">6.4 Button Mapping with xmodmap for Devices in Core Mode</A>
</H2>
<P>
<P>
<A NAME="_Toc465765725"></A>
xmodmap will only modify the Core Pointer. As there is only one Core pointer at
a time, it makes no difference between the physical devices which may become
the Core Pointer. You may set this device manually with <EM>xsetpointer device</EM>.
<P>For the moment, let us forget the whole XInput stuff and
think of a left-hander who just wants to swap the left and right mouse buttons.
You would execute
<EM>xmodmap -pp</EM>
to look what the current assignment is. You
should get the following table back:
<BLOCKQUOTE><CODE>
<PRE>
Physical Button
Button Code
1 1 # ( Left Button )
2 2 # ( Right Button )
3 3 # ( Middle Button )
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>To swap the buttons, you do a
<EM>xmodmap -e &quot;pointer = 2 1 3&quot;</EM>
, and to get
back,
<EM>xmodmap -e &quot;pointer = default&quot;</EM>
. This should work with every device
with at least two buttons. Note that the term
<EM>&quot;pointer = x x x&quot;</EM>
has to be quoted
to prevent it from being changed by the shell.
<P>
<P>
<H2><A NAME="ss6.5">6.5 Button Mapping with xinput for Devices in Extension Mode</A>
</H2>
<P>
<P>
<A NAME="_Toc465765726"></A> <P>Back to XInput now. If you use the gimp, you may want to change the button
mapping for each device separately (may be you are happy with the mouse but
want to swap the two side-switches of the pen). Frederic Lepied has written a
utility called
<A HREF="Wacom-Tablet-HOWTO-3.html#_XInput">xinput</A>
for that.
<P>To swap the side-switches, you would do a
<EM>xinput list</EM>
to get a list of the
devices and their current settings. Swapping is done with
<EM>xinput
set-button-map Pen1 1 3 2</EM>
where
<EM>Pen1</EM>
is the Device to change.
<P>Starting with XFree 3.3.2 this works also with devices that
are configured
<EM>AlwaysCore</EM>
in XF86Config.
<P>
<P>
<H2><A NAME="ss6.6">6.6 xsetmode - changing absolute / relative mode</A>
</H2>
<P>
<P>
<A NAME="_Toc465765727"></A> <P>
<P>With xsetmode you can change the mode of a device between absolute and relative.
<P><B>Example:</B><BR>
<EM>xsetmode GraphireMouse ABSOLUTE</EM>
.
<P>
<P>
<H2><A NAME="ss6.7">6.7 xsetpointer - setting the default core device</A>
</H2>
<P>
<P>
<A NAME="_Toc465765728"></A> <P>If you have none of your devices configured
<EM>AlwaysCore</EM>
and you want
a device to become the core-pointer, then xsetpointer must be used.
<P>Do a
<EM>xsetpointer Devicename</EM>
. The old core-device (usually the
mouse) is not usable anymore and the one you specified should be active. For
example I can make the graphire mouse the standard core device from within a
running XFree.
<P><EM>xsetpointer -l</EM>
lists all devices and the modes they are in.
<P>
<H2><A NAME="ss6.8">6.8 Keys</A>
</H2>
<P>
<A NAME="_Toc465765729"></A>
Some devices have macro keys or pads on them, to which a scancode or string may be
assigned. This works only for devices in extension mode and is therefore done
in the application you want use the keys with.
<P><EM>xinput -l</EM> gives information about the number of keys and things
like the first scancode.
<P>
<P>
<H2><A NAME="ss6.9">6.9 Utilities to use more than one tablet and for toggle support on / off</A>
</H2>
<P>
<P>
<A NAME="_Toc465765730"></A> <P>I own myself 3 tablets of Wacom and use them on my notebook. Whenever no
tablets are connected and
I start X, I have to wait very long until the driver gives up. If xdm is used,
this increases to multiple of that timeouts.
<P>I have written two utilities which should make live easier with that:
<P>
<UL>
<LI>The shell script
<B>sx</B>
for those who use startx.
sx uses the dialog tool to present a nice menu where the user can choose:
<UL>
<LI>one of up to 10 devices (tablet, joystick, ...)</LI>
<LI>for notebooks, which display to use (internal or external display)</LI>
<LI>which window-manager to use</LI>
</UL>
<P>
<P>
<P>
</LI>
<LI>The small gtk-application
<B>xinput-chooser</B>
for those who use xdm.
xinput-chooser presents the user a menu whenever the xdm login screen is shown,
from which one of up to ten different configurations can be chosen.</LI>
</UL>
<P>
<P>The concept behind this is that a XF86Config file is split in at least a
XF86Config.bare file, which holds the information common to all configurations,
and various snippets, each of them holding the special information for a
particular configuration.
<P>The two utilities will then concat the parts back to a working configuration.
<P>
<P>You can get this packet from
<A HREF="http://www.runkel-it.de/download">http://www.runkel-it.de/download</A>
, it is named xinput_chooser_sr.
<P>
<P>
<HR>
<A HREF="Wacom-Tablet-HOWTO-7.html">Next</A>
<A HREF="Wacom-Tablet-HOWTO-5.html">Previous</A>
<A HREF="Wacom-Tablet-HOWTO.html#toc6">Contents</A>
</BODY>
</HTML>