diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-01-06 21:54:09 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-01-06 21:54:09 -0500 |
| commit | 4a0c54f0bad4a853e5bec7b9ad7ad5c6e1e32bd2 (patch) | |
| tree | 465dce77e1a65e7bf14ea154126c284c6083f409 /marsond.8 | |
| parent | d565dd895c8029b8dd6afcf9bd41ea7c77a69ae9 (diff) | |
| download | marsond-4a0c54f0bad4a853e5bec7b9ad7ad5c6e1e32bd2.tar.gz | |
Handle left and right shift, allow shift+enter.
Diffstat (limited to 'marsond.8')
| -rw-r--r-- | marsond.8 | 41 |
1 files changed, 29 insertions, 12 deletions
@@ -27,9 +27,9 @@ 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 "2026-01-05" "0.4.0" "Urchlay's Stuff" +.TH "MARSOND" 8 "2026-01-06" "0.4.0" "Urchlay's Stuff" .SH NAME -marsond \- Fix Enter key timing on Marson/USBLink/MT606-1 PS/2-USB adaptors +marsond \- Fix Enter/Shift key timings on Marson/USBLink/MT606-1 PS/2-USB adaptors .SH SYNOPSIS .sp marsond [\fB\-d\fP \fIdelay\-ms\fP] [\fB\-f\fP] [\fB\-k\fP \fIkeyboard\-device\fP] [\fB\-p\fP \fIpause_ms\fP [\fB\-v\fP] | [\fB\-\-help\fP] | [\fB\-\-version\fP] | [\fB\-V\fP] @@ -43,9 +43,10 @@ In games and emulators, the Enter key only works sometimes. This is caused by the firmware in the adaptor sending the keypress and release events only 8 milliseconds apart. .IP \(bu 2 -In normal use, pressing and releasing the right Shift key and Enter +In normal use, pressing either Shift key and Enter key simultaneously causes the shift key to get "stuck" and act like -it\(aqs still being held down. +it\(aqs still being held down. You have to press and release Shift again +to get it to "unstick". .UNINDENT .sp See the \fBNOTES\fP section for full details. @@ -67,8 +68,10 @@ Options can be "bundled": \fB\-vf\fP is the same as \fB\-v\fP \fB\-f\fP\&. .INDENT 0.0 .TP .BI \-d \ delay\-ms -Amount of time in milliseconds to delay the Enter key release events. -Minimum 1, default 30 (unless changed at compile time; see \fB\-\-help\fP). +Amount of time in milliseconds to delay the Enter key release +events. Also, the Shift key threshold is this times 4, unless set +with the \fB\-s\fP option. Minimum 1, default 30 (unless changed at +compile time; see \fB\-\-help\fP). .UNINDENT .\" delay time for Enter key release. . @@ -111,6 +114,16 @@ if started manually. Minimum 0, default 0. . .INDENT 0.0 .TP +.BI \-s \ thresh\-ms +Threshold for Shift key. If Enter is pressed within \fBthresh\-ms\fP of +either Shift key, a Shift key release will be sent before the Enter +keypress. This avoids the "stuck shift key" problem. Default is +120, or 4 times the \fB\-d\fP delay if set. +.UNINDENT +.\" threshold in ms for shift key followed by enter (default 30 or -d * 3). +. +.INDENT 0.0 +.TP .B \-v Verbose debugging mode. Prints copious trace information to \fBstderr\fP\&. Debugging mode is turned off when \fBmarsond\fP forks itself into the @@ -153,11 +166,13 @@ The Enter key dropped keystroke problem happens with any SDL application (SDL1 or SDL2), as well as other graphics libraries. It happens regardless of what PS/2 keyboard you have plugged in, what computer you have the adaptor plugged into, or what OS that computer -is running. +is running. The firmware in the adaptor sends an Enter keypress, then +8 microseconds later sends an Enter key release. There is no way to +change this. .sp The problem where Shift/Enter causes the Shift key to act "stuck" happens in any application. It\(aqs particularly annoying because I\(aqm an -inaccurate typist, and I hit Shift+Enter about 5% of the time when I\(aqm +inaccurate typist, and I hit right Shift+Enter about 5% of the time when I\(aqm just trying to press Enter. .sp The specific hardware that has the problems for me is USB @@ -213,10 +228,12 @@ the real keyboard to the virtual one. When it sees the key release event for the Enter key, it simply pauses for a few milliseconds before delivering it. .sp -It also keeps track of whether the last keypress was the right Shift -key, and when it sees an Enter keypress while right Shift is held -down, it sends a right Shift key release event before the Enter press -event. +It also keeps track of the last timestamp of the left and right Shift +keys, and if Enter is pressed too soon after Shift, it sends a key +release for the Shift key(s). It\(aqs still possible to type Shift+Enter +on purpose, but there must be a delay (default 120ms) between the two +keypresses. Most people, even fast typists, won\(aqt press them that +close together. .sp This should work with everything that uses the keyboard. It definitely does, with SDL 1 and 2 running under X (and SDL 1 on the console, |
