Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Commit 0cbd896

Browse files
author
Nicole Borrelli
committed
Initial commit
0 parents  commit 0cbd896

File tree

5 files changed

+908
-0
lines changed

5 files changed

+908
-0
lines changed

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
touchdaemon : src/touchdaemon.c
3+
g++ -lX11 -lXi src/touchdaemon.c -o touchdaemon
4+
5+
clean:
6+
rm touchdaemon
7+
8+
tar:
9+
tar -cf touchdaemon.tar ../touchdaemon --exclude=.git
10+
11+
install:
12+
[ -d /usr/bin ] || mkdir /usr/bin -p
13+
cp touchdaemon /usr/bin/touchdaemon

README

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
EDIT: This is a fork of http://sourceforge.net/projects/touchdaemon/
2+
I haven't cleaned up the code yet, or updated this file. Sorry. Soon(tm).
3+
4+
### MAIN CODE
5+
6+
compilation: g++ -lX11 -lXi touchdaemon.c -o name
7+
8+
./name '-c<command>' the quotas are against spaces and doublequotes in the command
9+
example:
10+
./name '-cxinput set-prop "Logitech USB Gaming Mouse" "Device Enabled"'
11+
12+
You get the xinput string by tipping "xinput list", picking out your touchpad name and replace my "Logitech USB Gaming Mouse".
13+
14+
See the help options to get more functionalities. XRecod ( -R) is deactivated.
15+
To press one key for more than a second sets the touchpad to enabled.
16+
17+
18+
### TOOLS:
19+
20+
There is a script from Hielos to alternate the touchpad status on demand

include/synaptics-properties.h

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/*
2+
* Copyright © 2008 Red Hat, Inc.
3+
*
4+
* Permission to use, copy, modify, distribute, and sell this software
5+
* and its documentation for any purpose is hereby granted without
6+
* fee, provided that the above copyright notice appear in all copies
7+
* and that both that copyright notice and this permission notice
8+
* appear in supporting documentation, and that the name of Red Hat
9+
* not be used in advertising or publicity pertaining to distribution
10+
* of the software without specific, written prior permission. Red
11+
* Hat makes no representations about the suitability of this software
12+
* for any purpose. It is provided "as is" without express or implied
13+
* warranty.
14+
*
15+
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16+
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17+
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18+
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20+
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21+
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22+
*
23+
* Authors: Peter Hutterer
24+
*/
25+
26+
#ifndef _SYNAPTICS_PROPERTIES_H_
27+
#define _SYNAPTICS_PROPERTIES_H_
28+
29+
/**
30+
* Properties exported by the synaptics driver. These properties are
31+
* recognized by the driver and will change its behavior when modified.
32+
* For a description of what each property does, see synaptics.h.
33+
*/
34+
35+
/* 32 bit, 4 values, left, right, top, bottom */
36+
#define SYNAPTICS_PROP_EDGES "Synaptics Edges"
37+
38+
/* 32 bit, 3 values, low, high, press */
39+
#define SYNAPTICS_PROP_FINGER "Synaptics Finger"
40+
41+
/* 32 bit */
42+
#define SYNAPTICS_PROP_TAP_TIME "Synaptics Tap Time"
43+
44+
/* 32 bit */
45+
#define SYNAPTICS_PROP_TAP_MOVE "Synaptics Tap Move"
46+
47+
/* 32 bit, 3 values, single touch timeout, max tapping time for double
48+
* taps, duration of a single click */
49+
#define SYNAPTICS_PROP_TAP_DURATIONS "Synaptics Tap Durations"
50+
51+
/* 8 bit (BOOL) */
52+
#define SYNAPTICS_PROP_TAP_FAST "Synaptics Tap FastTap"
53+
54+
/* 32 bit */
55+
#define SYNAPTICS_PROP_MIDDLE_TIMEOUT "Synaptics Middle Button Timeout"
56+
57+
/* 32 bit */
58+
#define SYNAPTICS_PROP_TWOFINGER_PRESSURE "Synaptics Two-Finger Pressure"
59+
60+
/* 32 bit */
61+
#define SYNAPTICS_PROP_TWOFINGER_WIDTH "Synaptics Two-Finger Width"
62+
63+
/* 32 bit, 2 values, vert, horiz */
64+
#define SYNAPTICS_PROP_SCROLL_DISTANCE "Synaptics Scrolling Distance"
65+
66+
/* 8 bit (BOOL), 3 values, vertical, horizontal, corner */
67+
#define SYNAPTICS_PROP_SCROLL_EDGE "Synaptics Edge Scrolling"
68+
69+
/* 8 bit (BOOL), 2 values, vertical, horizontal */
70+
#define SYNAPTICS_PROP_SCROLL_TWOFINGER "Synaptics Two-Finger Scrolling"
71+
72+
/* FLOAT, 4 values, min, max, accel, trackstick */
73+
#define SYNAPTICS_PROP_SPEED "Synaptics Move Speed"
74+
75+
/* 32 bit, 2 values, min, max */
76+
#define SYNAPTICS_PROP_EDGEMOTION_PRESSURE "Synaptics Edge Motion Pressure"
77+
78+
/* 32 bit, 2 values, min, max */
79+
#define SYNAPTICS_PROP_EDGEMOTION_SPEED "Synaptics Edge Motion Speed"
80+
81+
/* 8 bit (BOOL) */
82+
#define SYNAPTICS_PROP_EDGEMOTION "Synaptics Edge Motion Always"
83+
84+
/* 8 bit (BOOL), 2 values, updown, leftright */
85+
#define SYNAPTICS_PROP_BUTTONSCROLLING "Synaptics Button Scrolling"
86+
87+
/* 8 bit (BOOL), 2 values, updown, leftright */
88+
#define SYNAPTICS_PROP_BUTTONSCROLLING_REPEAT "Synaptics Button Scrolling Repeat"
89+
90+
/* 32 bit */
91+
#define SYNAPTICS_PROP_BUTTONSCROLLING_TIME "Synaptics Button Scrolling Time"
92+
93+
/* 8 bit, valid values (0, 1, 2) */
94+
#define SYNAPTICS_PROP_OFF "Synaptics Off"
95+
96+
/* 8 bit (BOOL) */
97+
#define SYNAPTICS_PROP_GUESTMOUSE "Synaptics Guestmouse Off"
98+
99+
/* 8 bit (BOOL) */
100+
#define SYNAPTICS_PROP_LOCKED_DRAGS "Synaptics Locked Drags"
101+
102+
/* 32 bit */
103+
#define SYNAPTICS_PROP_LOCKED_DRAGS_TIMEOUT "Synaptics Locked Drags Timeout"
104+
105+
/* 8 bit, up to MAX_TAP values (see synaptics.h), 0 disables an
106+
* element. order: RT, RB, LT, LB, F1, F2, F3 */
107+
#define SYNAPTICS_PROP_TAP_ACTION "Synaptics Tap Action"
108+
109+
/* 8 bit, up to MAX_CLICK values (see synaptics.h), 0 disables an
110+
* element. order: Finger 1, 2, 3 */
111+
#define SYNAPTICS_PROP_CLICK_ACTION "Synaptics Click Action"
112+
113+
/* 8 bit (BOOL) */
114+
#define SYNAPTICS_PROP_CIRCULAR_SCROLLING "Synaptics Circular Scrolling"
115+
116+
/* FLOAT */
117+
#define SYNAPTICS_PROP_CIRCULAR_SCROLLING_DIST "Synaptics Circular Scrolling Distance"
118+
119+
/* 8 bit, valid values 0..8 (inclusive)
120+
* order: any edge, top, top + right, right, right + bottom, bottom, bottom +
121+
* left, left, left + top */
122+
#define SYNAPTICS_PROP_CIRCULAR_SCROLLING_TRIGGER "Synaptics Circular Scrolling Trigger"
123+
124+
/* 8 bit (BOOL) */
125+
#define SYNAPTICS_PROP_CIRCULAR_PAD "Synaptics Circular Pad"
126+
127+
/* 8 bit (BOOL) */
128+
#define SYNAPTICS_PROP_PALM_DETECT "Synaptics Palm Detection"
129+
130+
/* 32 bit, 2 values, width, z */
131+
#define SYNAPTICS_PROP_PALM_DIMENSIONS "Synaptics Palm Dimensions"
132+
133+
/* FLOAT */
134+
#define SYNAPTICS_PROP_COASTING_SPEED "Synaptics Coasting Speed"
135+
136+
/* 32 bit, 2 values, min, max */
137+
#define SYNAPTICS_PROP_PRESSURE_MOTION "Synaptics Pressure Motion"
138+
139+
/* FLOAT, 2 values, min, max */
140+
#define SYNAPTICS_PROP_PRESSURE_MOTION_FACTOR "Synaptics Pressure Motion Factor"
141+
142+
/* 8 bit (BOOL) */
143+
#define SYNAPTICS_PROP_GRAB "Synaptics Grab Event Device"
144+
145+
/* 8 bit (BOOL), 1 value, tap-and-drag */
146+
#define SYNAPTICS_PROP_GESTURES "Synaptics Gestures"
147+
148+
/* 8 bit (BOOL), 5 values (read-only), has_left, has_middle, has_right,
149+
* has_double, has_triple */
150+
#define SYNAPTICS_PROP_CAPABILITIES "Synaptics Capabilities"
151+
152+
/* 32 bit unsigned, 2 values, vertical, horizontal in units/millimeter */
153+
#define SYNAPTICS_PROP_RESOLUTION "Synaptics Pad Resolution"
154+
155+
/* 32 bit, 4 values, left, right, top, bottom */
156+
#define SYNAPTICS_PROP_AREA "Synaptics Area"
157+
158+
#endif /* _SYNAPTICS_PROPERTIES_H_ */

include/synaptics.h

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
/*
2+
* Permission to use, copy, modify, distribute, and sell this software
3+
* and its documentation for any purpose is hereby granted without
4+
* fee, provided that the above copyright notice appear in all copies
5+
* and that both that copyright notice and this permission notice
6+
* appear in supporting documentation, and that the name of Red Hat
7+
* not be used in advertising or publicity pertaining to distribution
8+
* of the software without specific, written prior permission. Red
9+
* Hat makes no representations about the suitability of this software
10+
* for any purpose. It is provided "as is" without express or implied
11+
* warranty.
12+
*
13+
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
14+
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
15+
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
16+
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
17+
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
18+
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
19+
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20+
*/
21+
22+
#ifndef _SYNAPTICS_H_
23+
#define _SYNAPTICS_H_
24+
25+
#include <X11/Xdefs.h>
26+
27+
/******************************************************************************
28+
* Public definitions.
29+
* Used by driver and the shared memory configurator
30+
*****************************************************************************/
31+
typedef enum {
32+
RT_TAP = 0, /* Right top corner */
33+
RB_TAP, /* Right bottom corner */
34+
LT_TAP, /* Left top corner */
35+
LB_TAP, /* Left bottom corner */
36+
F1_TAP, /* Non-corner tap, one finger */
37+
F2_TAP, /* Non-corner tap, two fingers */
38+
F3_TAP, /* Non-corner tap, three fingers */
39+
MAX_TAP
40+
} TapEvent;
41+
42+
typedef enum {
43+
F1_CLICK1 = 0, /* Click left, one finger */
44+
F2_CLICK1, /* Click left, two fingers */
45+
F3_CLICK1, /* Click left, three fingers */
46+
MAX_CLICK
47+
} ClickFingerEvent;
48+
49+
#define SYN_MAX_BUTTONS 12 /* Max number of mouse buttons */
50+
51+
#define SHM_SYNAPTICS 23947
52+
typedef struct _SynapticsSHM
53+
{
54+
int version; /* Driver version */
55+
56+
/* Current device state */
57+
int x, y; /* actual x, y coordinates */
58+
int z; /* pressure value */
59+
int numFingers; /* number of fingers */
60+
int fingerWidth; /* finger width value */
61+
int left, right, up, down; /* left/right/up/down buttons */
62+
Bool multi[8];
63+
Bool middle;
64+
int guest_left, guest_mid, guest_right; /* guest device buttons */
65+
int guest_dx, guest_dy; /* guest device movement */
66+
} SynapticsSHM;
67+
68+
/*
69+
* Minimum and maximum values for scroll_button_repeat
70+
*/
71+
#define SBR_MIN 10
72+
#define SBR_MAX 1000
73+
74+
/*
75+
* The x/y limits are taken from the Synaptics TouchPad interfacing Guide,
76+
* section 2.3.2, which says that they should be valid regardless of the
77+
* actual size of the sensor.
78+
*/
79+
#define XMIN_NOMINAL 1472
80+
#define XMAX_NOMINAL 5472
81+
#define YMIN_NOMINAL 1408
82+
#define YMAX_NOMINAL 4448
83+
84+
#define XMAX_VALID 6143
85+
86+
#endif /* _SYNAPTICS_H_ */

0 commit comments

Comments
 (0)