summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2004-05-09 12:09:27 +0200
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:02:22 +0200
commit5d2b7423ed0717031129af579effd7eec4d99cef (patch)
tree22a465dab37bab41284b53243596bc042fbe9a4f
parent77c952aa279c6ae0897bba6322ad4de0ac5f7a1f (diff)
Small cleanup.
-rw-r--r--synaptics.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/synaptics.c b/synaptics.c
index f785f3f..e6824df 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -1180,7 +1180,6 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
Bool finger;
int dx, dy, buttons, id;
edge_type edge;
- Bool mid;
int change;
struct ScrollData scroll;
int double_click;
@@ -1216,14 +1215,13 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
hw->down |= hw->multi[1];
/* 3rd button emulation */
- mid = HandleMidButtonEmulation(priv, hw, &delay);
- mid |= hw->middle;
+ hw->middle |= HandleMidButtonEmulation(priv, hw, &delay);
/* Up/Down button scrolling or middle/double click */
double_click = FALSE;
if (!para->updown_button_scrolling) {
if (hw->down) { /* map down button to middle button */
- mid = TRUE;
+ hw->middle = TRUE;
}
if (hw->up) { /* up button generates double click */
@@ -1263,16 +1261,13 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
delay = MIN(delay, timeleft);
- buttons = ((hw->left ? 0x01 : 0) |
- (mid ? 0x02 : 0) |
- (hw->right ? 0x04 : 0) |
- (hw->guest_left ? 0x01 : 0) |
- (hw->guest_mid ? 0x02 : 0) |
- (hw->guest_right ? 0x04 : 0) |
- (hw->up ? 0x08 : 0) |
- (hw->down ? 0x10 : 0) |
- (hw->multi[2] ? 0x20 : 0) |
- (hw->multi[3] ? 0x40 : 0));
+ buttons = (((hw->left || hw->guest_left) ? 0x01 : 0) |
+ ((hw->middle || hw->guest_mid) ? 0x02 : 0) |
+ ((hw->right || hw->guest_right) ? 0x04 : 0) |
+ (hw->up ? 0x08 : 0) |
+ (hw->down ? 0x10 : 0) |
+ (hw->multi[2] ? 0x20 : 0) |
+ (hw->multi[3] ? 0x40 : 0));
if (priv->tap_button > 0) {
int tap_mask = 1 << (priv->tap_button - 1);