Some mice have two wheels

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9088 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2004-09-28 11:20:45 +00:00
parent fa42f1c2b9
commit 7d5d344bf1
4 changed files with 12 additions and 5 deletions

View File

@ -111,7 +111,8 @@ typedef struct {
int32 clicks;
int32 modifiers;
bigtime_t timestamp;
int32 wheel_delta;
int32 wheel_ydelta;
int32 wheel_xdelta;
} mouse_movement;

View File

@ -7,3 +7,8 @@ Addon <input>mouse : input_server/devices :
: false
: be <nogrist>input_server ;
if $(COMPILE_FOR_R5) {
} else {
LinkSharedOSLibs <input>mouse : <boot!home!config!lib>libopenbeos.so ;
}

View File

@ -371,6 +371,7 @@ MouseInputDevice::DeviceWatcher(void *arg)
BMessage *message;
char log[128];
while (dev->active) {
memset(&movements, 0, sizeof(movements));
if (ioctl(dev->driver_fd, kGetMouseMovements, &movements) < B_OK)
continue;
@ -418,12 +419,12 @@ MouseInputDevice::DeviceWatcher(void *arg)
}
}
if (movements.wheel_delta != 0) {
if ((movements.wheel_ydelta != 0) || (movements.wheel_xdelta != 0)) {
message = new BMessage(B_MOUSE_WHEEL_CHANGED);
if (message) {
message->AddInt64("when", movements.timestamp);
message->AddFloat("be:wheel_delta_x", 0.0);
message->AddFloat("be:wheel_delta_y", movements.wheel_delta);
message->AddFloat("be:wheel_delta_x", movements.wheel_xdelta);
message->AddFloat("be:wheel_delta_y", movements.wheel_ydelta);
sSingletonMouseDevice->EnqueueMessage(message);
}

View File

@ -512,7 +512,7 @@ interpret_ms_buffer(my_device_info *my_dev)
info.ydelta = -value;
break;
case USAGE_ID_WHEEL:
info.wheel_delta = -value;
info.wheel_ydelta = -value;
break;
}
}