mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
xf86-input-mouse port: fix mouse device
This commit is contained in:
@@ -14,10 +14,10 @@ index 6c453cd..e27bdcb 100644
|
|||||||
|
|
||||||
diff --git xf86-input-mouse-workdir/src/astral_mouse.c xf86-input-mouse-workdir/src/astral_mouse.c
|
diff --git xf86-input-mouse-workdir/src/astral_mouse.c xf86-input-mouse-workdir/src/astral_mouse.c
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..49644ac
|
index 0000000..d3a4a60
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ xf86-input-mouse-workdir/src/astral_mouse.c
|
+++ xf86-input-mouse-workdir/src/astral_mouse.c
|
||||||
@@ -0,0 +1,126 @@
|
@@ -0,0 +1,119 @@
|
||||||
+#ifdef HAVE_XORG_CONFIG_H
|
+#ifdef HAVE_XORG_CONFIG_H
|
||||||
+#include <xorg-config.h>
|
+#include <xorg-config.h>
|
||||||
+#endif
|
+#endif
|
||||||
@@ -41,14 +41,12 @@ index 0000000..49644ac
|
|||||||
+
|
+
|
||||||
+#include <sys/stat.h>
|
+#include <sys/stat.h>
|
||||||
+
|
+
|
||||||
+
|
|
||||||
+#define MOUSE_FLAG_RB 1
|
+#define MOUSE_FLAG_RB 1
|
||||||
+#define MOUSE_FLAG_MB 2
|
+#define MOUSE_FLAG_MB 2
|
||||||
+#define MOUSE_FLAG_LB 4
|
+#define MOUSE_FLAG_LB 4
|
||||||
+#define MOUSE_FLAG_B4 8
|
+#define MOUSE_FLAG_B4 8
|
||||||
+#define MOUSE_FLAG_B5 16
|
+#define MOUSE_FLAG_B5 16
|
||||||
+
|
+
|
||||||
+
|
|
||||||
+typedef struct {
|
+typedef struct {
|
||||||
+ int flags;
|
+ int flags;
|
||||||
+ int x,y,z;
|
+ int x,y,z;
|
||||||
@@ -67,11 +65,9 @@ index 0000000..49644ac
|
|||||||
+
|
+
|
||||||
+ mouse->PostEvent(pInfo, b, packet.x, -packet.y, packet.z, 0);
|
+ mouse->PostEvent(pInfo, b, packet.x, -packet.y, packet.z, 0);
|
||||||
+ }
|
+ }
|
||||||
+
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static Bool astralPreInit(InputInfoPtr pInfo, const char* proto, int flag) {
|
+static Bool astralPreInit(InputInfoPtr pInfo, const char* proto, int flag) {
|
||||||
+
|
|
||||||
+ MouseDevPtr mouse;
|
+ MouseDevPtr mouse;
|
||||||
+
|
+
|
||||||
+ mouse = pInfo->private;
|
+ mouse = pInfo->private;
|
||||||
@@ -89,14 +85,11 @@ index 0000000..49644ac
|
|||||||
+ mouse->CommonOptions(pInfo);
|
+ mouse->CommonOptions(pInfo);
|
||||||
+ pInfo->read_input = astralReadInput;
|
+ pInfo->read_input = astralReadInput;
|
||||||
+ return true;
|
+ return true;
|
||||||
+
|
|
||||||
+
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+#define DEVPATH "/dev/mouse"
|
+#define DEVPATH "/dev/mouse0"
|
||||||
+
|
+
|
||||||
+static const char* getdevice(InputInfoPtr pInfo, const char* proto, int flag){
|
+static const char* getdevice(InputInfoPtr pInfo, const char* proto, int flag){
|
||||||
+
|
|
||||||
+ struct stat st;
|
+ struct stat st;
|
||||||
+
|
+
|
||||||
+ if(stat(DEVPATH, &st) == -1)
|
+ if(stat(DEVPATH, &st) == -1)
|
||||||
@@ -105,7 +98,6 @@ index 0000000..49644ac
|
|||||||
+ pInfo->options = xf86AddNewOption(pInfo->options, "Device", DEVPATH);
|
+ pInfo->options = xf86AddNewOption(pInfo->options, "Device", DEVPATH);
|
||||||
+
|
+
|
||||||
+ return DEVPATH;
|
+ return DEVPATH;
|
||||||
+
|
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static int interfacesupport() {
|
+static int interfacesupport() {
|
||||||
@@ -135,6 +127,7 @@ index 0000000..49644ac
|
|||||||
+
|
+
|
||||||
+ if (!p)
|
+ if (!p)
|
||||||
+ return NULL;
|
+ return NULL;
|
||||||
|
+
|
||||||
+ p->SupportedInterfaces = interfacesupport;
|
+ p->SupportedInterfaces = interfacesupport;
|
||||||
+ p->BuiltinNames = protonames;
|
+ p->BuiltinNames = protonames;
|
||||||
+ p->FindDevice = getdevice;
|
+ p->FindDevice = getdevice;
|
||||||
|
|||||||
Reference in New Issue
Block a user