Change mouse speed parameters

Prior to this change, the mouse delays were between 50 ms to 250 ms,
with a difference of 50 ms between steps. Unfortunately, this was too
slow at lower speeds, therefore, the delays have been changed to vary
from 30 ms to 70 ms with a difference of 10 ms between steps. This gives
a much smoother mouse response.
reverse-scroll
nirenjan 2021-09-15 09:23:06 -07:00
parent 4365e86f2a
commit d8fc859e44
3 changed files with 21 additions and 20 deletions

View File

@ -15,19 +15,20 @@
#include "x52d_const.h"
#include "x52d_mouse.h"
// Mouse speed is the delay between subsequent mouse reports
#define DEFAULT_MOUSE_SPEED 250000
// Mouse speed is the delay in microseconds between subsequent mouse reports
#define DEFAULT_MOUSE_DELAY 70000
#define MOUSE_DELAY_DELTA 10000
volatile bool mouse_enabled = false;
volatile int mouse_delay = DEFAULT_MOUSE_SPEED;
volatile int mouse_delay = DEFAULT_MOUSE_DELAY;
#define MAX_MOUSE_SPEED 5
static const int mouse_speed_map[MAX_MOUSE_SPEED] = {
250000,
200000,
150000,
100000,
50000,
DEFAULT_MOUSE_DELAY,
DEFAULT_MOUSE_DELAY - MOUSE_DELAY_DELTA*1,
DEFAULT_MOUSE_DELAY - MOUSE_DELAY_DELTA*2,
DEFAULT_MOUSE_DELAY - MOUSE_DELAY_DELTA*3,
DEFAULT_MOUSE_DELAY - MOUSE_DELAY_DELTA*4,
};
void x52d_cfg_set_Mouse_Enabled(bool enabled)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: x52pro-linux 0.2.2\n"
"Report-Msgid-Bugs-To: https://github.com/nirenjan/x52pro-linux/issues\n"
"POT-Creation-Date: 2021-09-15 00:09-0700\n"
"POT-Creation-Date: 2021-09-15 09:25-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -142,11 +142,11 @@ msgstr ""
msgid "Unknown LED state %d"
msgstr ""
#: libx52/x52_stringify.c:47 daemon/x52d_clock.c:28 daemon/x52d_mouse.c:36
#: libx52/x52_stringify.c:47 daemon/x52d_clock.c:28 daemon/x52d_mouse.c:37
msgid "off"
msgstr ""
#: libx52/x52_stringify.c:48 daemon/x52d_clock.c:28 daemon/x52d_mouse.c:36
#: libx52/x52_stringify.c:48 daemon/x52d_clock.c:28 daemon/x52d_mouse.c:37
msgid "on"
msgstr ""
@ -735,17 +735,17 @@ msgstr ""
msgid "Shutting down X52 I/O driver thread"
msgstr ""
#: daemon/x52d_mouse.c:35
#: daemon/x52d_mouse.c:36
#, c-format
msgid "Setting mouse enable to %s"
msgstr ""
#: daemon/x52d_mouse.c:47
#: daemon/x52d_mouse.c:48
#, c-format
msgid "Setting mouse speed to %d (delay %d ms)"
msgstr ""
#: daemon/x52d_mouse.c:51
#: daemon/x52d_mouse.c:52
#, c-format
msgid "Ignoring mouse speed %d outside supported range (0-%d)"
msgstr ""

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: x52pro-linux 0.2.1\n"
"Report-Msgid-Bugs-To: https://github.com/nirenjan/x52pro-linux/issues\n"
"POT-Creation-Date: 2021-09-15 00:09-0700\n"
"POT-Creation-Date: 2021-09-15 09:25-0700\n"
"PO-Revision-Date: 2021-09-15 00:12-0700\n"
"Last-Translator: Nirenjan Krishnan <nirenjan@gmail.com>\n"
"Language-Team: Dummy Language for testing i18n\n"
@ -142,11 +142,11 @@ msgstr "YYay-MMay-DDay"
msgid "Unknown LED state %d"
msgstr "Unknownay EDLay atestay %d"
#: libx52/x52_stringify.c:47 daemon/x52d_clock.c:28 daemon/x52d_mouse.c:36
#: libx52/x52_stringify.c:47 daemon/x52d_clock.c:28 daemon/x52d_mouse.c:37
msgid "off"
msgstr "offay"
#: libx52/x52_stringify.c:48 daemon/x52d_clock.c:28 daemon/x52d_mouse.c:36
#: libx52/x52_stringify.c:48 daemon/x52d_clock.c:28 daemon/x52d_mouse.c:37
msgid "on"
msgstr "onay"
@ -784,17 +784,17 @@ msgstr "Erroray %d initializingay I/O iverdray eadthray: %s"
msgid "Shutting down X52 I/O driver thread"
msgstr "Uttingshay ownday X52 I/O iverdray eadthray"
#: daemon/x52d_mouse.c:35
#: daemon/x52d_mouse.c:36
#, c-format
msgid "Setting mouse enable to %s"
msgstr "Ettingsay ousemay enableay otay %s"
#: daemon/x52d_mouse.c:47
#: daemon/x52d_mouse.c:48
#, c-format
msgid "Setting mouse speed to %d (delay %d ms)"
msgstr "Ettingsay ousemay eedspay otay %d (elayday %d ms)"
#: daemon/x52d_mouse.c:51
#: daemon/x52d_mouse.c:52
#, c-format
msgid "Ignoring mouse speed %d outside supported range (0-%d)"
msgstr "Ignoringay ousemay eedspay %d outsideay upportedsay angeray (0-%d)"