Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
xorg
driver
xf86-input-synaptics
Commits
c09a3d50
Commit
c09a3d50
authored
Apr 17, 2009
by
Peter Hutterer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove Synaptics SHM configuration bits.
The only thing we still export through SHM is the hardware state.
parent
93a53312
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
147 additions
and
136 deletions
+147
-136
include/synaptics.h
include/synaptics.h
+0
-59
src/alpscomm.c
src/alpscomm.c
+2
-1
src/eventcomm.c
src/eventcomm.c
+2
-2
src/properties.c
src/properties.c
+3
-3
src/ps2comm.c
src/ps2comm.c
+2
-1
src/psmcomm.c
src/psmcomm.c
+2
-1
src/synaptics.c
src/synaptics.c
+67
-63
src/synapticsstr.h
src/synapticsstr.h
+67
-4
src/synproto.h
src/synproto.h
+2
-2
No files found.
include/synaptics.h
View file @
c09a3d50
...
...
@@ -75,65 +75,6 @@ typedef struct _SynapticsSHM
/* Probed hardware properties */
struct
SynapticsHwInfo
synhw
;
/* Parameter data */
int
left_edge
,
right_edge
,
top_edge
,
bottom_edge
;
/* edge coordinates absolute */
int
finger_low
,
finger_high
,
finger_press
;
/* finger detection values in Z-values */
int
tap_time
;
int
tap_move
;
/* max. tapping time and movement in packets and coord. */
int
single_tap_timeout
;
/* timeout to recognize a single tap */
int
tap_time_2
;
/* max. tapping time for double taps */
int
click_time
;
/* The duration of a single click */
Bool
fast_taps
;
/* Faster reaction to single taps */
int
emulate_mid_button_time
;
/* Max time between left and right button presses to
emulate a middle button press. */
int
emulate_twofinger_z
;
/* pressure threshold to emulate two finger touch (for Alps) */
int
emulate_twofinger_w
;
/* Finger width threshold to emulate two finger touch */
int
scroll_dist_vert
;
/* Scrolling distance in absolute coordinates */
int
scroll_dist_horiz
;
/* Scrolling distance in absolute coordinates */
Bool
scroll_edge_vert
;
/* Enable/disable vertical scrolling on right edge */
Bool
scroll_edge_horiz
;
/* Enable/disable horizontal scrolling on left edge */
Bool
scroll_edge_corner
;
/* Enable/disable continuous edge scrolling when in the corner */
Bool
scroll_twofinger_vert
;
/* Enable/disable vertical two-finger scrolling */
Bool
scroll_twofinger_horiz
;
/* Enable/disable horizontal two-finger scrolling */
Bool
special_scroll_area_right
;
/* Enable/disable autodetection right special scroll area */
double
min_speed
,
max_speed
,
accl
;
/* movement parameters */
double
trackstick_speed
;
/* trackstick mode speed */
int
edge_motion_min_z
;
/* finger pressure at which minimum edge motion speed is set */
int
edge_motion_max_z
;
/* finger pressure at which maximum edge motion speed is set */
int
edge_motion_min_speed
;
/* slowest setting for edge motion speed */
int
edge_motion_max_speed
;
/* fastest setting for edge motion speed */
Bool
edge_motion_use_always
;
/* If false, egde motion is used only when dragging */
Bool
updown_button_scrolling
;
/* Up/Down-Button scrolling or middle/double-click */
Bool
leftright_button_scrolling
;
/* Left/right-button scrolling, or two lots of middle button */
Bool
updown_button_repeat
;
/* If up/down button being used to scroll, auto-repeat?*/
Bool
leftright_button_repeat
;
/* If left/right button being used to scroll, auto-repeat? */
int
scroll_button_repeat
;
/* time, in milliseconds, between scroll events being
* sent when holding down scroll buttons */
int
touchpad_off
;
/* Switches the touchpad off
* 0 : Not off
* 1 : Off
* 2 : Only tapping and scrolling off
*/
Bool
guestmouse_off
;
/* Switches the guest mouse off */
Bool
locked_drags
;
/* Enable locked drags */
int
locked_drag_time
;
/* timeout for locked drags */
int
tap_action
[
MAX_TAP
];
/* Button to report on tap events */
int
click_action
[
MAX_CLICK
];
/* Button to report on click with fingers */
Bool
circular_scrolling
;
/* Enable circular scrolling */
double
scroll_dist_circ
;
/* Scrolling angle radians */
int
circular_trigger
;
/* Trigger area for circular scrolling */
Bool
circular_pad
;
/* Edge has an oval or circular shape */
Bool
palm_detect
;
/* Enable Palm Detection */
int
palm_min_width
;
/* Palm detection width */
int
palm_min_z
;
/* Palm detection depth */
double
coasting_speed
;
/* Coasting threshold scrolling speed */
int
press_motion_min_z
;
/* finger pressure at which minimum pressure motion factor is applied */
int
press_motion_max_z
;
/* finger pressure at which maximum pressure motion factor is applied */
double
press_motion_min_factor
;
/* factor applied on speed when finger pressure is at minimum */
double
press_motion_max_factor
;
/* factor applied on speed when finger pressure is at minimum */
Bool
grab_event_device
;
/* grab event device for exclusive use? */
}
SynapticsSHM
;
/*
...
...
src/alpscomm.c
View file @
c09a3d50
...
...
@@ -36,6 +36,7 @@
#include "alpscomm.h"
#include "synproto.h"
#include "synaptics.h"
#include "synapticsstr.h"
#include <xf86.h>
...
...
@@ -86,7 +87,7 @@ ALPS_initialize(int fd)
}
static
void
ALPSDeviceOnHook
(
LocalDevicePtr
local
,
Synaptics
SHM
*
para
)
ALPSDeviceOnHook
(
LocalDevicePtr
local
,
Synaptics
Parameters
*
para
)
{
}
...
...
src/eventcomm.c
View file @
c09a3d50
...
...
@@ -56,7 +56,7 @@
****************************************************************************/
static
void
EventDeviceOnHook
(
LocalDevicePtr
local
,
Synaptics
SHM
*
para
)
EventDeviceOnHook
(
LocalDevicePtr
local
,
Synaptics
Parameters
*
para
)
{
if
(
para
->
grab_event_device
)
{
/* Try to grab the event device so that data don't leak to /dev/input/mice */
...
...
@@ -234,7 +234,7 @@ EventReadHwState(LocalDevicePtr local, struct SynapticsHwInfo *synhw,
Bool
v
;
struct
SynapticsHwState
*
hw
=
&
(
comm
->
hwState
);
SynapticsPrivate
*
priv
=
(
SynapticsPrivate
*
)
local
->
private
;
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
while
(
SynapticsReadEvent
(
comm
,
&
ev
))
{
switch
(
ev
.
type
)
{
...
...
src/properties.c
View file @
c09a3d50
...
...
@@ -133,7 +133,7 @@ void
InitDeviceProperties
(
LocalDevicePtr
local
)
{
SynapticsPrivate
*
priv
=
(
SynapticsPrivate
*
)
local
->
private
;
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
int
values
[
9
];
/* we never have more than 9 values in an atom */
float
fvalues
[
4
];
/* never have more than 4 float values */
...
...
@@ -259,8 +259,8 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
{
LocalDevicePtr
local
=
(
LocalDevicePtr
)
dev
->
public
.
devicePrivate
;
SynapticsPrivate
*
priv
=
(
SynapticsPrivate
*
)
local
->
private
;
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
SHM
tmp
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
Synaptics
Parameters
tmp
;
/* If checkonly is set, no parameters may be changed. So just let the code
* change temporary variables and forget about it. */
...
...
src/ps2comm.c
View file @
c09a3d50
...
...
@@ -40,6 +40,7 @@
#include "ps2comm.h"
#include "synproto.h"
#include "synaptics.h"
#include "synapticsstr.h"
#include <xf86.h>
#define MAX_UNSYNC_PACKETS 10
/* i.e. 10 to 60 bytes */
...
...
@@ -445,7 +446,7 @@ ps2_print_ident(const struct SynapticsHwInfo *synhw)
static
void
PS2DeviceOnHook
(
LocalDevicePtr
local
,
Synaptics
SHM
*
para
)
PS2DeviceOnHook
(
LocalDevicePtr
local
,
Synaptics
Parameters
*
para
)
{
}
...
...
src/psmcomm.c
View file @
c09a3d50
...
...
@@ -44,6 +44,7 @@
#include <string.h>
#include "synproto.h"
#include "synaptics.h"
#include "synapticsstr.h"
#include "ps2comm.h"
/* ps2_print_ident() */
#include <xf86.h>
...
...
@@ -100,7 +101,7 @@ PSMQueryIsSynaptics(LocalDevicePtr local)
}
static
void
PSMDeviceOnHook
(
LocalDevicePtr
local
,
Synaptics
SHM
*
para
)
PSMDeviceOnHook
(
LocalDevicePtr
local
,
Synaptics
Parameters
*
para
)
{
}
...
...
src/synaptics.c
View file @
c09a3d50
...
...
@@ -13,7 +13,7 @@
* Copyright 2006 Christian Thaeter
* Copyright 2007 Joseph P. Skudlarek
* Copyright 2008 Fedor P. Goncharov
* Copyright 2008 Red Hat, Inc.
* Copyright 2008
-2009
Red Hat, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
...
...
@@ -233,10 +233,9 @@ SetDeviceAndProtocol(LocalDevicePtr local)
}
/*
* Allocate and initialize memory for the Synaptics
SHM
data to hold
driver
*
paramet
er settings.
* Allocate and initialize
read-only
memory for the Synaptics
Parameters
data to hold
*
driv
er settings.
* The function will allocate shared memory if priv->shm_config is TRUE.
* The allocated data is initialized from priv->synpara_default.
*/
static
Bool
alloc_param_data
(
LocalDevicePtr
local
)
...
...
@@ -244,57 +243,56 @@ alloc_param_data(LocalDevicePtr local)
int
shmid
;
SynapticsPrivate
*
priv
=
local
->
private
;
if
(
priv
->
syn
para
)
if
(
priv
->
syn
shm
)
return
TRUE
;
/* Already allocated */
if
(
priv
->
shm_config
)
{
if
((
shmid
=
shmget
(
SHM_SYNAPTICS
,
0
,
0
))
!=
-
1
)
shmctl
(
shmid
,
IPC_RMID
,
NULL
);
if
((
shmid
=
shmget
(
SHM_SYNAPTICS
,
sizeof
(
SynapticsSHM
),
077
7
|
IPC_CREAT
))
==
-
1
)
{
077
4
|
IPC_CREAT
))
==
-
1
)
{
xf86Msg
(
X_ERROR
,
"%s error shmget
\n
"
,
local
->
name
);
return
FALSE
;
}
if
((
priv
->
syn
para
=
(
SynapticsSHM
*
)
shmat
(
shmid
,
NULL
,
0
))
==
NULL
)
{
if
((
priv
->
syn
shm
=
(
SynapticsSHM
*
)
shmat
(
shmid
,
NULL
,
0
))
==
NULL
)
{
xf86Msg
(
X_ERROR
,
"%s error shmat
\n
"
,
local
->
name
);
return
FALSE
;
}
}
else
{
priv
->
syn
para
=
xcalloc
(
1
,
sizeof
(
SynapticsSHM
));
if
(
!
priv
->
syn
para
)
priv
->
syn
shm
=
xcalloc
(
1
,
sizeof
(
SynapticsSHM
));
if
(
!
priv
->
syn
shm
)
return
FALSE
;
}
*
(
priv
->
synpara
)
=
priv
->
synpara_default
;
return
TRUE
;
}
/*
* Free Synaptics
SHM
data previously allocated by alloc_param_data().
* Free Synaptics
Parameters
data previously allocated by alloc_param_data().
*/
static
void
free_param_data
(
SynapticsPrivate
*
priv
)
{
int
shmid
;
if
(
!
priv
->
syn
para
)
if
(
!
priv
->
syn
shm
)
return
;
if
(
priv
->
shm_config
)
{
if
((
shmid
=
shmget
(
SHM_SYNAPTICS
,
0
,
0
))
!=
-
1
)
shmctl
(
shmid
,
IPC_RMID
,
NULL
);
}
else
{
xfree
(
priv
->
syn
para
);
xfree
(
priv
->
syn
shm
);
}
priv
->
syn
para
=
NULL
;
priv
->
syn
shm
=
NULL
;
}
static
void
set_default_parameters
(
LocalDevicePtr
local
)
{
SynapticsPrivate
*
priv
=
local
->
private
;
/* read-only */
pointer
opts
=
local
->
options
;
/* read-only */
Synaptics
SHM
*
pars
=
&
priv
->
synpara
_default
;
/* modified */
Synaptics
Parameters
*
pars
=
&
priv
->
synpara
;
/* modified */
int
horizScrollDelta
,
vertScrollDelta
;
/* pixels */
int
tapMove
;
/* pixels */
...
...
@@ -313,7 +311,8 @@ static void set_default_parameters(LocalDevicePtr local)
Bool
vertTwoFingerScroll
,
horizTwoFingerScroll
;
/* read the parameters */
pars
->
version
=
(
PACKAGE_VERSION_MAJOR
*
10000
+
PACKAGE_VERSION_MINOR
*
100
+
PACKAGE_VERSION_PATCHLEVEL
);
if
(
priv
->
synshm
)
priv
->
synshm
->
version
=
(
PACKAGE_VERSION_MAJOR
*
10000
+
PACKAGE_VERSION_MINOR
*
100
+
PACKAGE_VERSION_PATCHLEVEL
);
/* The synaptics specs specify typical edge widths of 4% on x, and 5.4% on
* y (page 7) [Synaptics TouchPad Interfacing Guide, 510-000080 - A
...
...
@@ -582,7 +581,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
set_default_parameters
(
local
);
priv
->
largest_valid_x
=
MIN
(
priv
->
synpara
_default
.
right_edge
,
XMAX_NOMINAL
);
priv
->
largest_valid_x
=
MIN
(
priv
->
synpara
.
right_edge
,
XMAX_NOMINAL
);
if
(
!
alloc_param_data
(
local
))
goto
SetupProc_fail
;
...
...
@@ -701,7 +700,7 @@ DeviceOn(DeviceIntPtr dev)
return
!
Success
;
}
priv
->
proto_ops
->
DeviceOnHook
(
local
,
priv
->
synpara
);
priv
->
proto_ops
->
DeviceOnHook
(
local
,
&
priv
->
synpara
);
priv
->
comm
.
buffer
=
XisbNew
(
local
->
fd
,
64
);
if
(
!
priv
->
comm
.
buffer
)
{
...
...
@@ -827,10 +826,10 @@ static void
relative_coords
(
SynapticsPrivate
*
priv
,
int
x
,
int
y
,
double
*
relX
,
double
*
relY
)
{
int
minX
=
priv
->
synpara
->
left_edge
;
int
maxX
=
priv
->
synpara
->
right_edge
;
int
minY
=
priv
->
synpara
->
top_edge
;
int
maxY
=
priv
->
synpara
->
bottom_edge
;
int
minX
=
priv
->
synpara
.
left_edge
;
int
maxX
=
priv
->
synpara
.
right_edge
;
int
minY
=
priv
->
synpara
.
top_edge
;
int
maxY
=
priv
->
synpara
.
bottom_edge
;
double
xCenter
=
(
minX
+
maxX
)
/
2
.
0
;
double
yCenter
=
(
minY
+
maxY
)
/
2
.
0
;
...
...
@@ -847,8 +846,8 @@ relative_coords(SynapticsPrivate *priv, int x, int y,
static
double
angle
(
SynapticsPrivate
*
priv
,
int
x
,
int
y
)
{
double
xCenter
=
(
priv
->
synpara
->
left_edge
+
priv
->
synpara
->
right_edge
)
/
2
.
0
;
double
yCenter
=
(
priv
->
synpara
->
top_edge
+
priv
->
synpara
->
bottom_edge
)
/
2
.
0
;
double
xCenter
=
(
priv
->
synpara
.
left_edge
+
priv
->
synpara
.
right_edge
)
/
2
.
0
;
double
yCenter
=
(
priv
->
synpara
.
top_edge
+
priv
->
synpara
.
bottom_edge
)
/
2
.
0
;
return
atan2
(
-
(
y
-
yCenter
),
x
-
xCenter
);
}
...
...
@@ -895,17 +894,17 @@ edge_detection(SynapticsPrivate *priv, int x, int y)
{
edge_type
edge
=
0
;
if
(
priv
->
synpara
->
circular_pad
)
if
(
priv
->
synpara
.
circular_pad
)
return
circular_edge_detection
(
priv
,
x
,
y
);
if
(
x
>
priv
->
synpara
->
right_edge
)
if
(
x
>
priv
->
synpara
.
right_edge
)
edge
|=
RIGHT_EDGE
;
else
if
(
x
<
priv
->
synpara
->
left_edge
)
else
if
(
x
<
priv
->
synpara
.
left_edge
)
edge
|=
LEFT_EDGE
;
if
(
y
<
priv
->
synpara
->
top_edge
)
if
(
y
<
priv
->
synpara
.
top_edge
)
edge
|=
TOP_EDGE
;
else
if
(
y
>
priv
->
synpara
->
bottom_edge
)
else
if
(
y
>
priv
->
synpara
.
bottom_edge
)
edge
|=
BOTTOM_EDGE
;
return
edge
;
...
...
@@ -988,7 +987,7 @@ ReadInput(LocalDevicePtr local)
static
int
HandleMidButtonEmulation
(
SynapticsPrivate
*
priv
,
struct
SynapticsHwState
*
hw
,
int
*
delay
)
{
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
Bool
done
=
FALSE
;
int
timeleft
;
int
mid
=
0
;
...
...
@@ -1072,7 +1071,7 @@ HandleMidButtonEmulation(SynapticsPrivate *priv, struct SynapticsHwState *hw, in
static
int
SynapticsDetectFinger
(
SynapticsPrivate
*
priv
,
struct
SynapticsHwState
*
hw
)
{
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
int
finger
;
/* finger detection thru pressure and threshold */
...
...
@@ -1125,7 +1124,7 @@ SelectTapButton(SynapticsPrivate *priv, edge_type edge)
{
TapEvent
tap
;
if
(
priv
->
synpara
->
touchpad_off
==
2
)
{
if
(
priv
->
synpara
.
touchpad_off
==
2
)
{
priv
->
tap_button
=
0
;
return
;
}
...
...
@@ -1166,14 +1165,14 @@ SelectTapButton(SynapticsPrivate *priv, edge_type edge)
break
;
}
priv
->
tap_button
=
priv
->
synpara
->
tap_action
[
tap
];
priv
->
tap_button
=
priv
->
synpara
.
tap_action
[
tap
];
priv
->
tap_button
=
clamp
(
priv
->
tap_button
,
0
,
SYN_MAX_BUTTONS
);
}
static
void
SetTapState
(
SynapticsPrivate
*
priv
,
enum
TapState
tap_state
,
int
millis
)
{
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
DBG
(
7
,
ErrorF
(
"SetTapState - %d -> %d (millis:%d)
\n
"
,
priv
->
tap_state
,
tap_state
,
millis
));
switch
(
tap_state
)
{
case
TS_START
:
...
...
@@ -1224,7 +1223,7 @@ SetMovingState(SynapticsPrivate *priv, enum MovingState moving_state, int millis
static
int
GetTimeOut
(
SynapticsPrivate
*
priv
)
{
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
switch
(
priv
->
tap_state
)
{
case
TS_1
:
...
...
@@ -1248,7 +1247,7 @@ static int
HandleTapProcessing
(
SynapticsPrivate
*
priv
,
struct
SynapticsHwState
*
hw
,
edge_type
edge
,
enum
FingerState
finger
)
{
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
Bool
touch
,
release
,
is_timeout
,
move
;
int
timeleft
,
timeout
;
int
delay
=
1000000000
;
...
...
@@ -1412,7 +1411,7 @@ static int
ComputeDeltas
(
SynapticsPrivate
*
priv
,
struct
SynapticsHwState
*
hw
,
edge_type
edge
,
int
*
dxP
,
int
*
dyP
)
{
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
enum
MovingState
moving_state
;
int
dist
;
double
dx
,
dy
;
...
...
@@ -1473,7 +1472,7 @@ ComputeDeltas(SynapticsPrivate *priv, struct SynapticsHwState *hw,
}
else
{
edge_speed
=
minSpd
+
(
hw
->
z
-
minZ
)
*
(
maxSpd
-
minSpd
)
/
(
maxZ
-
minZ
);
}
if
(
!
priv
->
synpara
->
circular_pad
)
{
if
(
!
priv
->
synpara
.
circular_pad
)
{
/* on rectangular pad */
if
(
edge
&
RIGHT_EDGE
)
{
x_edge_speed
=
edge_speed
;
...
...
@@ -1558,7 +1557,7 @@ static void
start_coasting
(
SynapticsPrivate
*
priv
,
struct
SynapticsHwState
*
hw
,
edge_type
edge
,
Bool
vertical
)
{
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
priv
->
autoscroll_y
=
0
.
0
;
priv
->
autoscroll_x
=
0
.
0
;
...
...
@@ -1602,12 +1601,12 @@ static int
HandleScrolling
(
SynapticsPrivate
*
priv
,
struct
SynapticsHwState
*
hw
,
edge_type
edge
,
Bool
finger
,
struct
ScrollData
*
sd
)
{
Synaptics
SHM
*
para
=
priv
->
synpara
;
Synaptics
Parameters
*
para
=
&
priv
->
synpara
;
int
delay
=
1000000000
;
sd
->
left
=
sd
->
right
=
sd
->
up
=
sd
->
down
=
0
;
if
(
priv
->
synpara
->
touchpad_off
==
2
)
{
if
(
priv
->
synpara
.
touchpad_off
==
2
)
{
stop_coasting
(
priv
);
priv
->
circ_scroll_on
=
FALSE
;
priv
->
vert_scroll_edge_on
=
FALSE
;
...
...
@@ -1852,7 +1851,7 @@ HandleScrolling(SynapticsPrivate *priv, struct SynapticsHwState *hw,
}
static
void
HandleClickWithFingers
(
Synaptics
SHM
*
para
,
struct
SynapticsHwState
*
hw
)
HandleClickWithFingers
(
Synaptics
Parameters
*
para
,
struct
SynapticsHwState
*
hw
)
{
int
action
=
0
;
switch
(
hw
->
numFingers
){
...
...
@@ -1892,7 +1891,8 @@ static int
HandleState
(
LocalDevicePtr
local
,
struct
SynapticsHwState
*
hw
)
{
SynapticsPrivate
*
priv
=
(
SynapticsPrivate
*
)
(
local
->
private
);
SynapticsSHM
*
para
=
priv
->
synpara
;
SynapticsSHM
*
shm
=
priv
->
synshm
;
SynapticsParameters
*
para
=
&
priv
->
synpara
;
int
finger
;
int
dx
,
dy
,
buttons
,
rep_buttons
,
id
;
edge_type
edge
;
...
...
@@ -1904,23 +1904,26 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
int
i
;
/* update hardware state in shared memory */
para
->
x
=
hw
->
x
;
para
->
y
=
hw
->
y
;
para
->
z
=
hw
->
z
;
para
->
numFingers
=
hw
->
numFingers
;
para
->
fingerWidth
=
hw
->
fingerWidth
;
para
->
left
=
hw
->
left
;
para
->
right
=
hw
->
right
;
para
->
up
=
hw
->
up
;
para
->
down
=
hw
->
down
;
for
(
i
=
0
;
i
<
8
;
i
++
)
para
->
multi
[
i
]
=
hw
->
multi
[
i
];
para
->
middle
=
hw
->
middle
;
para
->
guest_left
=
hw
->
guest_left
;
para
->
guest_mid
=
hw
->
guest_mid
;
para
->
guest_right
=
hw
->
guest_right
;
para
->
guest_dx
=
hw
->
guest_dx
;
para
->
guest_dy
=
hw
->
guest_dy
;
if
(
shm
)
{
shm
->
x
=
hw
->
x
;
shm
->
y
=
hw
->
y
;
shm
->
z
=
hw
->
z
;
shm
->
numFingers
=
hw
->
numFingers
;
shm
->
fingerWidth
=
hw
->
fingerWidth
;
shm
->
left
=
hw
->
left
;
shm
->
right
=
hw
->
right
;
shm
->
up
=
hw
->
up
;
shm
->
down
=
hw
->
down
;
for
(
i
=
0
;
i
<
8
;
i
++
)
shm
->
multi
[
i
]
=
hw
->
multi
[
i
];
shm
->
middle
=
hw
->
middle
;
shm
->
guest_left
=
hw
->
guest_left
;
shm
->
guest_mid
=
hw
->
guest_mid
;
shm
->
guest_right
=
hw
->
guest_right
;
shm
->
guest_dx
=
hw
->
guest_dx
;
shm
->
guest_dy
=
hw
->
guest_dy
;
}
/* If touchpad is switched off, we skip the whole thing and return delay */
if
(
para
->
touchpad_off
==
1
)
...
...
@@ -1991,7 +1994,7 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
* hardware scroll area.
*/
if
(
para
->
special_scroll_area_right
)
priv
->
synpara
->
right_edge
=
priv
->
largest_valid_x
;
priv
->
synpara
.
right_edge
=
priv
->
largest_valid_x
;
}
edge
=
edge_detection
(
priv
,
hw
->
x
,
hw
->
y
);
...
...
@@ -2179,12 +2182,13 @@ static Bool
QueryHardware
(
LocalDevicePtr
local
)
{
SynapticsPrivate
*
priv
=
(
SynapticsPrivate
*
)
local
->
private
;
SynapticsSHM
*
para
=
priv
->
syn
para
;
SynapticsSHM
*
shm
=
priv
->
syn
shm
;
priv
->
comm
.
protoBufTail
=
0
;
if
(
priv
->
proto_ops
->
QueryHardware
(
local
,
&
priv
->
synhw
))
{
para
->
synhw
=
priv
->
synhw
;
if
(
shm
)
shm
->
synhw
=
priv
->
synhw
;
}
else
{
xf86Msg
(
X_PROBED
,
"%s: no supported touchpad found
\n
"
,
local
->
name
);
priv
->
proto_ops
->
DeviceOffHook
(
local
);
...
...
src/synapticsstr.h
View file @
c09a3d50
...
...
@@ -79,12 +79,75 @@ enum TapButtonState {
TBS_BUTTON_DOWN_UP
/* Send button down event + set up state */
};
typedef
struct
_SynapticsParameters
{
/* Parameter data */
int
left_edge
,
right_edge
,
top_edge
,
bottom_edge
;
/* edge coordinates absolute */
int
finger_low
,
finger_high
,
finger_press
;
/* finger detection values in Z-values */
int
tap_time
;
int
tap_move
;
/* max. tapping time and movement in packets and coord. */
int
single_tap_timeout
;
/* timeout to recognize a single tap */
int
tap_time_2
;
/* max. tapping time for double taps */
int
click_time
;
/* The duration of a single click */
Bool
fast_taps
;
/* Faster reaction to single taps */
int
emulate_mid_button_time
;
/* Max time between left and right button presses to
emulate a middle button press. */
int
emulate_twofinger_z
;
/* pressure threshold to emulate two finger touch (for Alps) */
int
emulate_twofinger_w
;
/* Finger width threshold to emulate two finger touch */
int
scroll_dist_vert
;
/* Scrolling distance in absolute coordinates */
int
scroll_dist_horiz
;
/* Scrolling distance in absolute coordinates */
Bool
scroll_edge_vert
;
/* Enable/disable vertical scrolling on right edge */
Bool
scroll_edge_horiz
;
/* Enable/disable horizontal scrolling on left edge */
Bool
scroll_edge_corner
;
/* Enable/disable continuous edge scrolling when in the corner */
Bool
scroll_twofinger_vert
;
/* Enable/disable vertical two-finger scrolling */
Bool
scroll_twofinger_horiz
;
/* Enable/disable horizontal two-finger scrolling */
Bool
special_scroll_area_right
;
/* Enable/disable autodetection right special scroll area */
double
min_speed
,
max_speed
,
accl
;
/* movement parameters */
double
trackstick_speed
;
/* trackstick mode speed */
int
edge_motion_min_z
;
/* finger pressure at which minimum edge motion speed is set */
int
edge_motion_max_z
;
/* finger pressure at which maximum edge motion speed is set */
int
edge_motion_min_speed
;
/* slowest setting for edge motion speed */
int
edge_motion_max_speed
;
/* fastest setting for edge motion speed */
Bool
edge_motion_use_always
;
/* If false, egde motion is used only when dragging */
Bool
updown_button_scrolling
;
/* Up/Down-Button scrolling or middle/double-click */
Bool
leftright_button_scrolling
;
/* Left/right-button scrolling, or two lots of middle button */
Bool
updown_button_repeat
;
/* If up/down button being used to scroll, auto-repeat?*/
Bool
leftright_button_repeat
;
/* If left/right button being used to scroll, auto-repeat? */
int
scroll_button_repeat
;
/* time, in milliseconds, between scroll events being
* sent when holding down scroll buttons */
int
touchpad_off
;
/* Switches the touchpad off
* 0 : Not off
* 1 : Off
* 2 : Only tapping and scrolling off
*/
Bool
guestmouse_off
;
/* Switches the guest mouse off */
Bool
locked_drags
;
/* Enable locked drags */
int
locked_drag_time
;
/* timeout for locked drags */
int
tap_action
[
MAX_TAP
];
/* Button to report on tap events */
int
click_action
[
MAX_CLICK
];
/* Button to report on click with fingers */
Bool
circular_scrolling
;
/* Enable circular scrolling */
double
scroll_dist_circ
;
/* Scrolling angle radians */
int
circular_trigger
;
/* Trigger area for circular scrolling */
Bool
circular_pad
;
/* Edge has an oval or circular shape */
Bool
palm_detect
;
/* Enable Palm Detection */
int
palm_min_width
;
/* Palm detection width */
int
palm_min_z
;
/* Palm detection depth */
double
coasting_speed
;
/* Coasting threshold scrolling speed */
int
press_motion_min_z
;
/* finger pressure at which minimum pressure motion factor is applied */
int
press_motion_max_z
;
/* finger pressure at which maximum pressure motion factor is applied */
double
press_motion_min_factor
;
/* factor applied on speed when finger pressure is at minimum */
double
press_motion_max_factor
;
/* factor applied on speed when finger pressure is at minimum */
Bool
grab_event_device
;
/* grab event device for exclusive use? */
}
SynapticsParameters
;
typedef
struct
_SynapticsPrivateRec
{
Synaptics
SHM
synpara_default
;
/* Default parameter settings, read from
the X config file */
SynapticsSHM
*
syn
para
;
/* Current parameter settings. Will point to
shared memory if shm_config is true */
Synaptics
Parameters
synpara
;
/* Default parameter settings, read from
the X config file */
SynapticsSHM
*
syn
shm
;
/* Current parameter settings. Will point to
shared memory if shm_config is true */
struct
SynapticsProtocolOperations
*
proto_ops
;
struct
SynapticsHwState
hwState
;
...
...
src/synproto.h
View file @
c09a3d50
...
...
@@ -84,12 +84,12 @@ enum SynapticsProtocol {
SYN_PROTO_ALPS
/* ALPS touchpad protocol */
};
struct
_Synaptics
SHM
;
struct
_Synaptics
Parameters
;
struct
SynapticsHwInfo
;
struct
CommData
;
struct
SynapticsProtocolOperations
{
void
(
*
DeviceOnHook
)(
LocalDevicePtr
local
,
struct
_Synaptics
SHM
*
para
);
void
(
*
DeviceOnHook
)(
LocalDevicePtr
local
,
struct
_Synaptics
Parameters
*
para
);
void
(
*
DeviceOffHook
)(
LocalDevicePtr
local
);
Bool
(
*
QueryHardware
)(
LocalDevicePtr
local
,
struct
SynapticsHwInfo
*
synhw
);
Bool
(
*
ReadHwState
)(
LocalDevicePtr
local
,
struct
SynapticsHwInfo
*
synhw
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment