aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--TODO4
-rw-r--r--marsond.86
-rw-r--r--marsond.c12
-rw-r--r--marsond.rst4
5 files changed, 15 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index edc2a9c..a7c2479 100644
--- a/Makefile
+++ b/Makefile
@@ -65,7 +65,7 @@ realclean: clean
# It specifically works on Slackware 15.0, if the system/musl package
# from SlackBuilds.org is installed.
static: clean
- $(MAKE) CC=musl-gcc COPT="-static -nostdinc -isystem /usr/include/musl -isystem /usr/include -Wl,-s"
+ $(MAKE) CC=musl-gcc COPT="-Os -static -nostdinc -isystem /usr/include/musl -isystem /usr/include -Wl,-s"
mv $(PROJ) $(PROJ).static
install: all
diff --git a/TODO b/TODO
index 46222a6..1a020dc 100644
--- a/TODO
+++ b/TODO
@@ -1,9 +1,5 @@
Definitely:
-- Find out why 'marsond virtual keyboard' is showing as both a
- keyboard and a pointer in 'xinput --list'. If possible, fix it
- so it only appears as a keyboard.
-
- Find an actual PS/2 mouse, plug it into the adaptor, make sure
the mouse port still works while marsond is running. It *should*
since it's a separate device under /dev/input, but it's better to
diff --git a/marsond.8 b/marsond.8
index f457aca..a48482f 100644
--- a/marsond.8
+++ b/marsond.8
@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
-.TH "MARSOND" 8 "2025-05-10" "0.3.0" "Urchlay's Stuff"
+.TH "MARSOND" 8 "2025-05-11" "0.3.0" "Urchlay's Stuff"
.SH NAME
marsond \- Fix Enter key timing on Marson/USBLink/MT606-1 PS/2-USB adaptors
.SH SYNOPSIS
@@ -201,9 +201,7 @@ drop privileges and run as the \fInobody\fP user by default (but see
.SS Misc
.sp
While \fBmarsond\fP is running, "xinput \-\-list" will show an input
-device called "marson virtual keyboard". Confusingly enough, it will
-show up as both a pointer and a keyboard. This doesn\(aqt seem to hurt
-anything, but it looks weird, doesn\(aqt it?
+device called "marson virtual keyboard", listed as a keyboard.
.SH LIMITATIONS
.sp
Only one MT\-606\-1 device is supported, out of the box. This shouldn\(aqt
diff --git a/marsond.c b/marsond.c
index 1644ef7..719129a 100644
--- a/marsond.c
+++ b/marsond.c
@@ -29,6 +29,12 @@
#define DEFAULT_USER "nobody"
#define DEFAULT_GROUP "nobody"
+/* uinput.h defines KEY_MAX for use with UI_SET_KEYBIT, but the
+ mouse buttons are included in the key constants, which makes
+ xinput think we're both a keyboard and a pointer. actual
+ keyboard keys stop before that. */
+#define LAST_KBD_KEY 255
+
const char *self;
int debugging = 0; /* -v */
@@ -309,7 +315,7 @@ int main(int argc, char **argv) {
/* the other event types will never be sent by a keyboard. */
/* we want all possible keystrokes */
- for(i = 0; i < KEY_MAX; i++) {
+ for(i = 0; i <= LAST_KBD_KEY; i++) {
if(ioctl(outfd, UI_SET_KEYBIT, i) >= 0) {
/* we don't wanna be *that* verbose */
} else {
@@ -421,4 +427,8 @@ event: type 0, code 0, value 0
Onlt the type 1 messages concern us, but we have to pass
them all through. code 28 is KEY_ENTER, value is 1 for press,
0 for release.
+
+from uinput.h:
+type 4 EV_MSC, code 4 MSC_SCAN.
+type 0 EV_SYN, code 0 SYN_REPORT.
*/
diff --git a/marsond.rst b/marsond.rst
index e094d44..756d54d 100644
--- a/marsond.rst
+++ b/marsond.rst
@@ -171,9 +171,7 @@ Misc
----
While **marsond** is running, "xinput --list" will show an input
-device called "marson virtual keyboard". Confusingly enough, it will
-show up as both a pointer and a keyboard. This doesn't seem to hurt
-anything, but it looks weird, doesn't it?
+device called "marson virtual keyboard", listed as a keyboard.
LIMITATIONS
===========