2 pen_mode.c -- Support ExpressKeys & Touch Strips on a Wacom Intuos3 tablet.
4 Copyright (C) 2005 - Mats Johannesson
6 Based on setmode.c 1996 by Frederic Lepied (xinput-1.2)
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
25 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26 Function opens the X input device (which stays open until program end)
27 and toggles mode between Absolute and Relative based on a flag status.
28 We make sure to only open the pen once by setting another flag.
29 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
31 int toggle_pen_mode(Display *display, char *name)
34 if (pen_mode == Absolute) {
41 fprintf(stderr, "PEN MODE = %d\n", pen_mode);
45 pen_device = XOpenDevice(display, pen_info->id);
48 if ((pen_device) && (pen_open)) {
49 XSetDeviceMode(display, pen_device, pen_mode);