mirror of
https://github.com/dschmenk/apple2pi.git
synced 2025-02-20 11:28:57 +00:00
Change mouse acceleration code
This commit is contained in:
parent
14875721f4
commit
414742d8c1
2
Makefile
2
Makefile
@ -1,5 +1,5 @@
|
|||||||
PACKAGE=a2pi
|
PACKAGE=a2pi
|
||||||
VERSION=0.1.3
|
VERSION=0.1.4
|
||||||
DIST=$(PACKAGE)-$(VERSION)
|
DIST=$(PACKAGE)-$(VERSION)
|
||||||
DISTDIR=./$(DIST)
|
DISTDIR=./$(DIST)
|
||||||
|
|
||||||
|
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,3 +1,9 @@
|
|||||||
|
a2pi (0.1.4-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* Change mouse accleration code from table lookup to squared value
|
||||||
|
|
||||||
|
-- David Schmenk <dschmenk@gmail.com> Mon, 4 Nov 2013 10:59:43 -0800
|
||||||
|
|
||||||
a2pi (0.1.3-1) unstable; urgency=low
|
a2pi (0.1.3-1) unstable; urgency=low
|
||||||
|
|
||||||
* Fix multi-thread locking in FUSE driver
|
* Fix multi-thread locking in FUSE driver
|
||||||
|
15
src/a2pid.c
15
src/a2pid.c
@ -332,8 +332,6 @@ int keycode[256] = {
|
|||||||
#define RUN 0
|
#define RUN 0
|
||||||
#define STOP 1
|
#define STOP 1
|
||||||
#define RESET 2
|
#define RESET 2
|
||||||
int accel[32] = { 0, 1, 4, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
|
|
||||||
-21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -4, -1};
|
|
||||||
volatile int state = RUN, isdaemon = FALSE;
|
volatile int state = RUN, isdaemon = FALSE;
|
||||||
struct input_event evkey, evrelx, evrely, evsync;
|
struct input_event evkey, evrelx, evrely, evsync;
|
||||||
|
|
||||||
@ -441,10 +439,15 @@ void sendbttn(int fd, int mod, int bttn)
|
|||||||
}
|
}
|
||||||
void sendrelxy(int fd, int x, int y)
|
void sendrelxy(int fd, int x, int y)
|
||||||
{
|
{
|
||||||
if (x > 4 || x < -4) x = x *4;
|
#if 0
|
||||||
else x = accel[x & 0x1F];
|
static int accel[32] = { 0, 1, 4, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
|
||||||
if (y > 4 || y < -4) y = y * 4;
|
-21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -4, -1};
|
||||||
else y = accel[y & 0x1F];
|
x = ((x > 4) || (x < -4)) ? x * 2 : accel[x & 0x1F];
|
||||||
|
y = ((y > 4) || (y < -4)) ? y * 2 : accel[y & 0x1F];
|
||||||
|
#else
|
||||||
|
x = x < 0 ? -x * x : x * x;
|
||||||
|
y = y < 0 ? -y * y : y * y;
|
||||||
|
#endif
|
||||||
evrelx.value = x;
|
evrelx.value = x;
|
||||||
evrely.value = y;
|
evrely.value = y;
|
||||||
write(fd, &evrelx, sizeof(evrelx));
|
write(fd, &evrelx, sizeof(evrelx));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user