aboutsummaryrefslogtreecommitdiff
path: root/src/emuWheel.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2008-08-07 16:57:06 +0930
committerPeter Hutterer <peter.hutterer@redhat.com>2008-08-08 15:51:09 +0930
commit4e121b297ee0a9b179f8188926564fb8b2c3f6c8 (patch)
tree0cbe00b75183b0c676f43b79f824ded64d9fb854 /src/emuWheel.c
parentExpose wheel emulation through device properties. (diff)
downloadxf86-input-evdev-4e121b297ee0a9b179f8188926564fb8b2c3f6c8.tar.gz
xf86-input-evdev-4e121b297ee0a9b179f8188926564fb8b2c3f6c8.tar.bz2
xf86-input-evdev-4e121b297ee0a9b179f8188926564fb8b2c3f6c8.zip
Add EVDEV_MAXBUTTONS instead of checking against 32.
Numbers are so lame, defines are all the rage now I've heard.
Diffstat (limited to 'src/emuWheel.c')
-rw-r--r--src/emuWheel.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/emuWheel.c b/src/emuWheel.c
index b82ba79..70ef41c 100644
--- a/src/emuWheel.c
+++ b/src/emuWheel.c
@@ -40,7 +40,6 @@
#include "evdev.h"
-#define MSE_MAXBUTTONS 32
#define WHEEL_NOT_CONFIGURED 0
static Atom prop_wheel_emu;
@@ -162,8 +161,8 @@ EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis, char* axis_
char *msg = NULL;
if ((sscanf(option_string, "%d %d", &up_button, &down_button) == 2) &&
- ((up_button > 0) && (up_button <= MSE_MAXBUTTONS)) &&
- ((down_button > 0) && (down_button <= MSE_MAXBUTTONS))) {
+ ((up_button > 0) && (up_button <= EVDEV_MAXBUTTONS)) &&
+ ((down_button > 0) && (down_button <= EVDEV_MAXBUTTONS))) {
/* Use xstrdup to allocate a string for us */
msg = xstrdup("buttons XX and YY");
@@ -211,7 +210,7 @@ EvdevWheelEmuPreInit(InputInfoPtr pInfo)
wheelButton = xf86SetIntOption(pInfo->options,
"EmulateWheelButton", 4);
- if ((wheelButton < 0) || (wheelButton > MSE_MAXBUTTONS)) {
+ if ((wheelButton < 0) || (wheelButton > EVDEV_MAXBUTTONS)) {
xf86Msg(X_WARNING, "%s: Invalid EmulateWheelButton value: %d\n",
pInfo->name, wheelButton);
xf86Msg(X_WARNING, "%s: Wheel emulation disabled.\n", pInfo->name);
@@ -457,7 +456,7 @@ EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val)
else if (atom == prop_wheel_button)
{
int bt = *((CARD8*)val->data);
- if (bt < 0 || bt >= MSE_MAXBUTTONS)
+ if (bt < 0 || bt >= EVDEV_MAXBUTTONS)
return FALSE;
pEvdev->emulateWheel.button = bt;
} else if (atom == prop_wheel_xmap)