xf86-input-mouse port: fix mouse device

This commit is contained in:
Matheus
2024-04-20 15:48:13 -03:00
parent 5f4513794f
commit 1748ff0afa
@@ -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
new file mode 100644
index 0000000..49644ac
index 0000000..d3a4a60
--- /dev/null
+++ xf86-input-mouse-workdir/src/astral_mouse.c
@@ -0,0 +1,126 @@
@@ -0,0 +1,119 @@
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
@@ -41,14 +41,12 @@ index 0000000..49644ac
+
+#include <sys/stat.h>
+
+
+#define MOUSE_FLAG_RB 1
+#define MOUSE_FLAG_MB 2
+#define MOUSE_FLAG_LB 4
+#define MOUSE_FLAG_B4 8
+#define MOUSE_FLAG_B5 16
+
+
+typedef struct {
+ int flags;
+ int x,y,z;
@@ -67,11 +65,9 @@ index 0000000..49644ac
+
+ mouse->PostEvent(pInfo, b, packet.x, -packet.y, packet.z, 0);
+ }
+
+}
+
+static Bool astralPreInit(InputInfoPtr pInfo, const char* proto, int flag) {
+
+ MouseDevPtr mouse;
+
+ mouse = pInfo->private;
@@ -89,14 +85,11 @@ index 0000000..49644ac
+ mouse->CommonOptions(pInfo);
+ pInfo->read_input = astralReadInput;
+ return true;
+
+
+}
+
+#define DEVPATH "/dev/mouse"
+#define DEVPATH "/dev/mouse0"
+
+static const char* getdevice(InputInfoPtr pInfo, const char* proto, int flag){
+
+ struct stat st;
+
+ if(stat(DEVPATH, &st) == -1)
@@ -105,7 +98,6 @@ index 0000000..49644ac
+ pInfo->options = xf86AddNewOption(pInfo->options, "Device", DEVPATH);
+
+ return DEVPATH;
+
+}
+
+static int interfacesupport() {
@@ -135,6 +127,7 @@ index 0000000..49644ac
+
+ if (!p)
+ return NULL;
+
+ p->SupportedInterfaces = interfacesupport;
+ p->BuiltinNames = protonames;
+ p->FindDevice = getdevice;