Lines 2-8
Link Here
|
2 |
** xidump.c |
2 |
** xidump.c |
3 |
** |
3 |
** |
4 |
** Copyright (C) 2003 - 2004 - John E. Joganic |
4 |
** Copyright (C) 2003 - 2004 - John E. Joganic |
5 |
** Copyright (C) 2004 - 2007 - Ping Cheng |
5 |
** Copyright (C) 2004 - 2008 - Ping Cheng |
6 |
** |
6 |
** |
7 |
** This program is free software; you can redistribute it and/or |
7 |
** This program is free software; you can redistribute it and/or |
8 |
** modify it under the terms of the GNU General Public License |
8 |
** modify it under the terms of the GNU General Public License |
Lines 30-35
Link Here
|
30 |
** 2006-05-05 0.7.4 - Removed older 2.6 kernels |
30 |
** 2006-05-05 0.7.4 - Removed older 2.6 kernels |
31 |
** 2006-07-19 0.7.5 - Support buttons and keys combined |
31 |
** 2006-07-19 0.7.5 - Support buttons and keys combined |
32 |
** 2007-01-10 0.7.7 - Don't list uninitialized tools |
32 |
** 2007-01-10 0.7.7 - Don't list uninitialized tools |
|
|
33 |
** 2008-05-06 0.8.0 - Support Xorg 7.3 or later |
33 |
** |
34 |
** |
34 |
****************************************************************************/ |
35 |
****************************************************************************/ |
35 |
|
36 |
|
Lines 41-47
Link Here
|
41 |
#include <sys/time.h> |
42 |
#include <sys/time.h> |
42 |
#include <math.h> |
43 |
#include <math.h> |
43 |
|
44 |
|
44 |
#define XIDUMP_VERSION "0.7.7" |
45 |
#define XIDUMP_VERSION "0.8.0" |
45 |
|
46 |
|
46 |
#include "../include/util-config.h" |
47 |
#include "../include/util-config.h" |
47 |
|
48 |
|
Lines 52-57
Link Here
|
52 |
#include <X11/Xlib.h> |
53 |
#include <X11/Xlib.h> |
53 |
#include <X11/extensions/XInput.h> |
54 |
#include <X11/extensions/XInput.h> |
54 |
#include <X11/extensions/XIproto.h> |
55 |
#include <X11/extensions/XIproto.h> |
|
|
56 |
#include <X11/keysym.h> |
55 |
|
57 |
|
56 |
enum |
58 |
enum |
57 |
{ |
59 |
{ |
Lines 156-163
int ListDevices(Display* pDisp, const char* pszDeviceName)
Link Here
|
156 |
(pDev->use == 0) ? "disabled" : |
158 |
(pDev->use == 0) ? "disabled" : |
157 |
(pDev->use == IsXKeyboard) ? "keyboard" : |
159 |
(pDev->use == IsXKeyboard) ? "keyboard" : |
158 |
(pDev->use == IsXPointer) ? "pointer" : |
160 |
(pDev->use == IsXPointer) ? "pointer" : |
159 |
(pDev->use == IsXExtensionDevice) ? "extension" : |
161 |
#ifndef WCM_ISXEXTENSIONPOINTER |
160 |
"unknown"); |
162 |
(pDev->use == IsXExtensionDevice) ? |
|
|
163 |
#else |
164 |
(pDev->use == IsXExtensionDevice || |
165 |
pDev->use == IsXExtensionKeyboard || |
166 |
pDev->use == IsXExtensionPointer) ? |
167 |
#endif |
168 |
"extension" : "unknown"); |
161 |
|
169 |
|
162 |
if (gnVerbose) |
170 |
if (gnVerbose) |
163 |
{ |
171 |
{ |
Lines 444-450
static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
Link Here
|
444 |
nTitleRow = nRow; |
452 |
nTitleRow = nRow; |
445 |
if (pValInfo) |
453 |
if (pValInfo) |
446 |
{ |
454 |
{ |
447 |
snprintf(chBuf,sizeof(chBuf),"Valuators: %s ID: Undefined Serial Number: Undefined", |
455 |
snprintf(chBuf,sizeof(chBuf),"Valuators: %s ID: Unreported Serial Number: Unreported", |
448 |
pValInfo->mode == Absolute ? "Absolute" : |
456 |
pValInfo->mode == Absolute ? "Absolute" : |
449 |
pValInfo->mode == Relative ? "Relative" : "Unknown"); |
457 |
pValInfo->mode == Relative ? "Relative" : "Unknown"); |
450 |
wacscrn_output(nRow,0,chBuf); |
458 |
wacscrn_output(nRow,0,chBuf); |
Lines 539-551
static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
Link Here
|
539 |
else |
547 |
else |
540 |
{ |
548 |
{ |
541 |
/* title value */ |
549 |
/* title value */ |
542 |
int v = (pMove->axis_data[3]&0xffff0000) >> 16; |
|
|
543 |
snprintf(chBuf,sizeof(chBuf),"%s", |
550 |
snprintf(chBuf,sizeof(chBuf),"%s", |
544 |
pValInfo->mode == Absolute ? "Absolute" : |
551 |
pValInfo->mode == Absolute ? "Absolute" : |
545 |
pValInfo->mode == Relative ? "Relative" : "Unknown"); |
552 |
pValInfo->mode == Relative ? "Relative" : "Unknown"); |
546 |
wacscrn_output(nTitleRow,11,chBuf); |
553 |
wacscrn_output(nTitleRow,11,chBuf); |
|
|
554 |
|
555 |
/* Device/tool ID can only be retrieved through the ToolID option |
556 |
* of xsetwacom due to valuator backward compatibility concern |
557 |
* |
558 |
v = (pMove->axis_data[3]&0xffff0000) >> 16; |
547 |
snprintf(chBuf, sizeof(chBuf), "%10d", v); |
559 |
snprintf(chBuf, sizeof(chBuf), "%10d", v); |
548 |
wacscrn_output(nTitleRow, 25, chBuf); |
560 |
wacscrn_output(nTitleRow, 25, chBuf); |
|
|
561 |
|
562 |
* serial number can only be retrieved through the ToolSerial option |
563 |
* of xsetwacom due to valuator backward compatibility concern |
564 |
* |
549 |
v = (pMove->axis_data[4]&0xffff0000) | |
565 |
v = (pMove->axis_data[4]&0xffff0000) | |
550 |
((pMove->axis_data[5]&0xffff0000)>>16); |
566 |
((pMove->axis_data[5]&0xffff0000)>>16); |
551 |
if ( v ) |
567 |
if ( v ) |
Lines 553-558
static int CursesRun(Display* pDisp, XDeviceInfo* pDevInfo, FORMATTYPE fmt)
Link Here
|
553 |
snprintf(chBuf,sizeof(chBuf), "%12d", v); |
569 |
snprintf(chBuf,sizeof(chBuf), "%12d", v); |
554 |
wacscrn_output(nTitleRow,52,chBuf); |
570 |
wacscrn_output(nTitleRow,52,chBuf); |
555 |
} |
571 |
} |
|
|
572 |
*/ |
556 |
|
573 |
|
557 |
for (k=0; k<pValInfo->num_axes && k<3; ++k) |
574 |
for (k=0; k<pValInfo->num_axes && k<3; ++k) |
558 |
{ |
575 |
{ |