Fixed some problems with ALPS guest devices.

From Alastair M. Robinson:

* The guest mouse doesn't report button releases.

* The stick pointer has buttons of its own, and they don't work.

  Attached is another patch, this one far less invasive than the last,
  which fixes these two problems.
  (The button presses that come from the stick pointer's buttons arrive
  in events with pressure set to 127, just like stick movement - but
  this doesn't seem to be terribly reliable - I think the button
  release gets reported with true pressure when the touchpad is being
  used too.  For this reason, I've set these up to report as ->left /
  ->right, not as ->guest_left / ->guest_right.)

* One issue that remains - the middle button emulation for two button
  mice doesn't seem to work for the guest mouse.
  Fixed by me.
This commit is contained in:
Peter Osterlund
2004-07-31 03:01:37 +02:00
parent b46a57ef3d
commit 7b610b2d4b
2 changed files with 12 additions and 10 deletions

View File

@@ -160,10 +160,8 @@ ALPS_process_packet(unsigned char *packet, struct SynapticsHwState *hw)
y = y - 256;
hw->guest_dx = x;
hw->guest_dy = -y;
if (packet[0] & 0x01)
hw->guest_left = 1;
if (packet[0] & 0x02)
hw->guest_right = 1;
hw->guest_left = (packet[0] & 0x01) ? TRUE : FALSE;
hw->quest_right = (packet[0] & 0x02) ? TRUE : FALSE;
return;
}
@@ -178,7 +176,10 @@ ALPS_process_packet(unsigned char *packet, struct SynapticsHwState *hw)
y = y - 512;
hw->guest_dx = x;
hw->guest_dy = -y;
z = 0;
hw->left = packet[2] & 1;
hw->left |= packet[3] & 1;
hw->right = (packet[2] >> 1) & 1;
hw->right |= (packet[3] >> 1) & 1;
return;
}

View File

@@ -1323,6 +1323,12 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
hw->up |= hw->multi[0];
hw->down |= hw->multi[1];
if (!para->guestmouse_off) {
hw->left |= hw->guest_left;
hw->middle |= hw->guest_mid;
hw->right |= hw->guest_right;
}
/* 3rd button emulation */
hw->middle |= HandleMidButtonEmulation(priv, hw, &delay);
@@ -1369,11 +1375,6 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
timeleft = ComputeDeltas(priv, hw, edge, &dx, &dy);
delay = MIN(delay, timeleft);
if (!para->guestmouse_off) {
hw->left |= hw->guest_left;
hw->middle |= hw->guest_mid;
hw->right |= hw->guest_right;
}
buttons = ((hw->left ? 0x01 : 0) |
(hw->middle ? 0x02 : 0) |
(hw->right ? 0x04 : 0) |