Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
3cb6d7c8
Commit
3cb6d7c8
authored
Apr 22, 2004
by
Dmitry Torokhov
Committed by
Vojtech Pavlik
Apr 22, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Input: support Synaptics touchpads that have separate middle button
parent
1a9e9e7c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
drivers/input/mouse/synaptics.c
drivers/input/mouse/synaptics.c
+11
-0
drivers/input/mouse/synaptics.h
drivers/input/mouse/synaptics.h
+2
-0
No files found.
drivers/input/mouse/synaptics.c
View file @
3cb6d7c8
...
...
@@ -184,6 +184,8 @@ static void print_ident(struct synaptics_data *priv)
if
(
SYN_CAP_MULTI_BUTTON_NO
(
priv
->
ext_cap
))
printk
(
KERN_INFO
" -> %d multi-buttons, i.e. besides standard buttons
\n
"
,
(
int
)(
SYN_CAP_MULTI_BUTTON_NO
(
priv
->
ext_cap
)));
if
(
SYN_CAP_MIDDLE_BUTTON
(
priv
->
capabilities
))
printk
(
KERN_INFO
" -> middle button
\n
"
);
if
(
SYN_CAP_FOUR_BUTTON
(
priv
->
capabilities
))
printk
(
KERN_INFO
" -> four buttons
\n
"
);
if
(
SYN_CAP_MULTIFINGER
(
priv
->
capabilities
))
...
...
@@ -342,6 +344,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
set_bit
(
BTN_LEFT
,
dev
->
keybit
);
set_bit
(
BTN_RIGHT
,
dev
->
keybit
);
if
(
SYN_CAP_MIDDLE_BUTTON
(
priv
->
capabilities
))
set_bit
(
BTN_MIDDLE
,
dev
->
keybit
);
if
(
SYN_CAP_FOUR_BUTTON
(
priv
->
capabilities
))
{
set_bit
(
BTN_FORWARD
,
dev
->
keybit
);
set_bit
(
BTN_BACK
,
dev
->
keybit
);
...
...
@@ -470,6 +475,9 @@ static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data
hw
->
left
=
(
buf
[
0
]
&
0x01
)
?
1
:
0
;
hw
->
right
=
(
buf
[
0
]
&
0x02
)
?
1
:
0
;
if
(
SYN_CAP_MIDDLE_BUTTON
(
priv
->
capabilities
))
hw
->
middle
=
((
buf
[
0
]
^
buf
[
3
])
&
0x01
)
?
1
:
0
;
if
(
SYN_CAP_FOUR_BUTTON
(
priv
->
capabilities
))
{
hw
->
up
=
((
buf
[
0
]
^
buf
[
3
])
&
0x01
)
?
1
:
0
;
hw
->
down
=
((
buf
[
0
]
^
buf
[
3
])
&
0x02
)
?
1
:
0
;
...
...
@@ -569,6 +577,9 @@ static void synaptics_process_packet(struct psmouse *psmouse)
input_report_key
(
dev
,
BTN_LEFT
,
hw
.
left
);
input_report_key
(
dev
,
BTN_RIGHT
,
hw
.
right
);
if
(
SYN_CAP_MIDDLE_BUTTON
(
priv
->
capabilities
))
input_report_key
(
dev
,
BTN_MIDDLE
,
hw
.
middle
);
if
(
SYN_CAP_FOUR_BUTTON
(
priv
->
capabilities
))
{
input_report_key
(
dev
,
BTN_FORWARD
,
hw
.
up
);
input_report_key
(
dev
,
BTN_BACK
,
hw
.
down
);
...
...
drivers/input/mouse/synaptics.h
View file @
3cb6d7c8
...
...
@@ -44,6 +44,7 @@ extern void synaptics_reset(struct psmouse *psmouse);
/* synaptics capability bits */
#define SYN_CAP_EXTENDED(c) ((c) & (1 << 23))
#define SYN_CAP_MIDDLE_BUTTON(c) ((c) & (1 << 18))
#define SYN_CAP_PASS_THROUGH(c) ((c) & (1 << 7))
#define SYN_CAP_SLEEP(c) ((c) & (1 << 4))
#define SYN_CAP_FOUR_BUTTON(c) ((c) & (1 << 3))
...
...
@@ -88,6 +89,7 @@ struct synaptics_hw_state {
int
w
;
unsigned
int
left
:
1
;
unsigned
int
right
:
1
;
unsigned
int
middle
:
1
;
unsigned
int
up
:
1
;
unsigned
int
down
:
1
;
unsigned
char
ext_buttons
;
...
...
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