Page 2 of 2
Re: libcurses keycodes wrong?
Posted: Tue Aug 10, 2021 2:20 pm
by NormanDunbar
NormanDunbar wrote:I might be wrong, it happens, but your 32 bytes might be the USB communications -- if your keyboard is or emulates USB of course.
I was indeed wrong. It seems, from Ben Eater, that USB comms is in 8 byte chunks, not 32.
Cheers,
Norm.
Re: libcurses keycodes wrong?
Posted: Tue Aug 10, 2021 2:31 pm
by NormanDunbar
Peter wrote:but some implementations use only the first three or four bytes.
Apparently upto 6 keys can be pressed, but for some cheap keyboards, there are no diodes on the matrix, so errors are reported instead of the"n" pressed keys. I learned this just today.
Cheers,
Norm.
Re: libcurses keycodes wrong?
Posted: Tue Aug 10, 2021 2:37 pm
by XorA
And back on the actual topic, I got a BBQL out to double check and to test the F? key behaviour.
An update to the patch is therefore.
Subject: [PATCH] INCLUDE_curses.h : correct keycodes
BACKSPACE
LEFT
RIGHT
UP
DOWN
F1-F5
all appear to be wrong in the file.
Signed-off-by: Graeme Gregory <
graeme@xora.org.uk>
---
INCLUDE_curses.h | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/INCLUDE_curses.h b/INCLUDE_curses.h
index cf56f49..ccc30e5 100644
--- a/INCLUDE_curses.h
+++ b/INCLUDE_curses.h
@@ -80,14 +80,17 @@ typedef unsigned long chtype;
#define ACS_BLOCK (_acs_ch['0'])
#endif
#define KEY_BREAK 0401
-#define KEY_DOWN 0402
-#define KEY_UP 0403
-#define KEY_LEFT 0404
-#define KEY_RIGHT 0405
+#define KEY_DOWN 0330
+#define KEY_UP 0320
+#define KEY_LEFT 0300
+#define KEY_RIGHT 0310
#define KEY_HOME 0406
-#define KEY_BACKSPACE 0407
-#define KEY_F0 0410
-#define KEY_F(n) (KEY_F0+(n))
+#define KEY_BACKSPACE 0302
+/* QL keyboard does not have an F0 key */
+/*#define KEY_F0 0410
+#define KEY_F(n) (KEY_F0+(n))*/
+/* F keys inscrease by 4 on QDOS */
+#define KEY_F(n) (0350 + ((n - 1) * 4)
#define KEY_DL 0510
#define KEY_IL 0511
#define KEY_DC 0512
--
2.30.2
I am wondering if all the impossible keys should be pulled out, does any emulator emulate extra keys?
Re: libcurses keycodes wrong?
Posted: Fri Aug 13, 2021 6:47 pm
by XorA
Interesting follow on to this, the libc for qdos-gcc already has these changes in it!
But whoever did those changes obviously got annoyed at some point.