libcurses keycodes wrong?

Anything QL Software or Programming Related.
User avatar
NormanDunbar
Forum Moderator
Posts: 2470
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: libcurses keycodes wrong?

Post 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.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
NormanDunbar
Forum Moderator
Posts: 2470
Joined: Tue Dec 14, 2010 9:04 am
Location: Buckie, Scotland
Contact:

Re: libcurses keycodes wrong?

Post 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. :D

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
XorA
Site Admin
Posts: 1629
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: libcurses keycodes wrong?

Post 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?


User avatar
XorA
Site Admin
Posts: 1629
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: libcurses keycodes wrong?

Post 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.

Code: Select all

#ifdef C68_IS_NOT_FSCKING_BROKEN


Post Reply