Treat BTN_[0-2] as LMR buttons if necessary.

Treat BTN_[0-2] as LMR buttons on devices that do not advertise BTN_LEFT,
BTN_MIDDLE, BTN_RIGHT (e.g. 3Dconnexion SpaceNavigator).

Otherwise, treat BTN_[0+n] as button 5+n. Note: This causes duplicate
mappings for BTN_0 + n and  BTN_SIDE + n.

This also fixes a bug where we could end up with negative button numbers after
trying to map BTN_0.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit 64554e4799)
This commit is contained in:
Peter Hutterer
2008-10-29 13:50:07 +10:30
parent 534a3734d0
commit 6bcbbc0411
2 changed files with 24 additions and 5 deletions

View File

@@ -119,7 +119,7 @@ typedef struct {
struct input_absinfo absinfo[ABS_MAX];
} EvdevRec, *EvdevPtr;
unsigned int EvdevUtilButtonEventToButtonNumber(int code);
unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code);
/* Middle Button emulation */
int EvdevMBEmuTimer(InputInfoPtr);