Add "Resolution" option for mice to the evdev driver

It can be used to scale the resolution of a mouse to that of a 1000 DPI
mouse. This can be useful to make high resolution mice less sensitive
without turning off acceleration. The target of 1000 DPI is used as the
same default is used in libinput. If the option is not set no scaling
will be done.

https://bugs.freedesktop.org/show_bug.cgi?id=88134
Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Thomas Hindoe Paaboel Andersen
2015-01-20 00:44:40 +01:00
committed by Peter Hutterer
parent 66c9978864
commit 034be31159
4 changed files with 34 additions and 13 deletions

View File

@@ -97,6 +97,8 @@
/* Number of longs needed to hold the given number of bits */
#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
#define DEFAULT_MOUSE_DPI 1000.0
/* Function key mode */
enum fkeymode {
FKEYMODE_UNKNOWN = 0,
@@ -170,6 +172,7 @@ typedef struct {
BOOL swap_axes;
BOOL invert_x;
BOOL invert_y;
int resolution;
unsigned int abs_queued, rel_queued, prox_queued;
@@ -191,7 +194,7 @@ typedef struct {
int button; /* phys button to emit */
int threshold; /* move threshold in dev coords */
OsTimerPtr timer;
int delta[2]; /* delta x/y, accumulating */
double delta[2]; /* delta x/y, accumulating */
int startpos[2]; /* starting pos for abs devices */
int flags; /* remember if we had rel or abs movement */
} emulate3B;
@@ -269,7 +272,7 @@ BOOL Evdev3BEmuFilterEvent(InputInfoPtr, int, BOOL);
void Evdev3BEmuPreInit(InputInfoPtr pInfo);
void Evdev3BEmuOn(InputInfoPtr);
void Evdev3BEmuFinalize(InputInfoPtr);
void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy);
void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, double dx, double dy);
void Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals);
/* Mouse Wheel emulation */