aboutsummaryrefslogtreecommitdiff
path: root/mousmain.c
diff options
context:
space:
mode:
Diffstat (limited to 'mousmain.c')
-rw-r--r--mousmain.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/mousmain.c b/mousmain.c
index 7198b56..e33b553 100644
--- a/mousmain.c
+++ b/mousmain.c
@@ -36,14 +36,20 @@
static nl_catd cat;
#if USE_WHEEL
-static bool detect_wheel()
+static bool detect_wheel(LPTSRDATA data)
{
// Do a quick check for a mouse wheel here.
// The TSR will do its own check when it is reset anyway
if (ps2m_detect_imps2()) {
+ if (ps2m_detect_imex()) {
+ data->num_wheels = 2;
+ } else {
+ data->num_wheels = 1;
+ }
printf(_(1, 0, "Wheel mouse found and enabled\n"));
return true;
} else {
+ data->num_wheels = 0;
return false;
}
}
@@ -54,7 +60,7 @@ static int set_wheel(LPTSRDATA data, bool enable)
data->usewheel = enable;
if (data->usewheel) {
- if (detect_wheel()) {
+ if (!detect_wheel(data)) {
fprintf(stderr, _(3, 0, "Could not find PS/2 wheel mouse\n"));
}
} else {
@@ -62,7 +68,7 @@ static int set_wheel(LPTSRDATA data, bool enable)
data->num_wheels = 0;
}
-return 0;
+ return 0;
}
static int set_wheel_key(LPTSRDATA data, const char *keyname)
@@ -263,7 +269,7 @@ static int configure_driver(LPTSRDATA data)
data->usewheel = true;
data->wheel_up_key = 0;
data->wheel_down_key = 0;
- detect_wheel(); // Prints message if wheel found
+ detect_wheel(data); // Prints message if wheel found
#endif
#if USE_INTEGRATION