Del Key Problem Solved!

I’m using WebCalc 6.00.02RC17 on my PicoCalc and the Del key doesn’t seem to do anything. When I press Shift-Del the cursor does go to the end of the line so I know the key itself is registering. Is this a known problem or an error in the port of WebMite to the PicoCalc?

Also, the key with the tilde on it shows a degree symbol instead of the apostrophe (or whatever that is) when no shift is pressed

1 Like

I tried using the release binary on my github. Using the built in PicoCalc keyboard at the prompt, and also in the editor, I didn’t see this behavior.

I do know that some weirdness can happen if you’re connected using a terminal program and using a remote keyboard instead of the one on the device. I had to change a few settings on PuTTY so the keys worked ok. Here’s a screenshot of my settings that worked. I remember I not only had to set it to a VT100+ terminal, but also had to set Backspace to “Control-H”. Settings are probably different for other terminal programs, but some tweaking might be needed to get all the keyboard keys to work.

Thanks for answering. I’m not using a terminal, just the PicoCalc keyboard. To get Del, I just press the Del key with no Shift and no Alt.
What is supposed to happen you press Del? Is it supposed to delete the character under the cursor and bring characters to the right of the cursor left one? That’s what I would expect but on my system, nothing happens.

It turns out I was wrong. :frowning: I thought I had the latest version installed, but I didn’t. I can’t read the lines on the top of my display so I couldn’t see the version number at boot. I copied over the RC17 firmware and tried it again just now, and I do have the problems you mentioned. The [~] key works with shift pressed, but shows the degree symbol instead of a [`]. And the [del] key does nothing, but does go to the end of the line with shift.

I didn’t try it on the Pico with the same release, but it probably has the same issue.

Created an issue to track it:

Not sure this is something I’ll dig into soon, since it seems kind of minor, though weird and definitely a bug. But if you notice any other keys that are affected please add to that issue on github.

Does PicoMite actually use the backtick on the tilde key for anything in code? The delete key might be more useful if it was working, but the backspace works, so there’s at least a way to delete characters.

1 Like

Am I missing something huge here or don’t the images from Backshed/MMBasic sites need a few modifications for the PicoCalc or they will not work as expected !?

You are correct. Stock images won’t work properly. You have to get a modified copy from somewhere. Right now the most advanced is at Release PicoCalc PicoMite V6.00.02RC17 · madcock/PicoMiteAllVersions · GitHub
I’m afraid we’ll always be slightly behind the latest betas.

1 Like

Worth noting: the sources for the new betas don’t always get posted anyway, so even if I had the time and intention to stay up to date with every minor update made, it would be impossible. I just checked, planning to sync it up today, and realized it was impossible right now.

Currently UKTailwind is at RC17 as shown by git history and the version number here.

I still think ignoring most beta releeases is the way to go. It’s just not practical (or even possible) to try to keep up to date. I’m guessing the main point releases are more stable anyway. Less likely to require code changes in people’s BASIC programs too. Though it does seem like most of the recent changes have been new functionality and bug fixes and are still backwards compatible with existing BASIC code. But that might be because it’s late in the RC cycle so Peter doesn’t want to risk major changes. I have only been following along for a few weeks (and dipping farther back into post history on the shed) so I don’t know what the release cycles usually look like.

1 Like

I know it’s not your fault. That’s the nature of third-party changes to code. We’re at the mercy of the authors to release it or not.

1 Like

Del key problem solved!

The picoCalc uses 0xd4 for DEL. Others use 0x7f

Change Editor.h and Hardware_Includes.h

Find

#define DEL 0x7f

and change to

#ifdef PICOCALC
#define DEL               0xd4
#else
#define DEL              0x7f
#endif
5 Likes

Has the I2c Keyboard not responding issue been solved yet? I am sticking with guu’s version, because every other build I have tried so far has exhibited that problem for me within a half hour of flashing it. Personally, I agree, there is no reason to try and keep up with Peter’s RC releases, doing a new build when a new minor revision is released is fine. Alternatively, maybe do a quarterly release in March, June, September and December.

Sadly, no. I realized my keyboard firmware was the original shipped version a day or so ago, so I tried flashing the updated keyboard firmware, and also tried the one here (which I kept because I like it). I was hoping maybe the new keyboard firmware would help with that disconnect issue, but it doesn’t. :frowning:

I guess it must be some kind of conflict with i2c (in PicoMite) going on.

I found some other PicoCalc projects recently on github, and decided to see if anyone else has figured out keyboard mappings, but it seems like everyone is reverse engineering it on their own since it’s not documented. (I was kind of hoping to stumble onto a mapping for the tilde/backtick key.)

This arduino project and this one and the NuttX port, have DEL with 0xd4, but don’t have mappings for all the keys. This arduino project should display keycodes though. So I plan to use that and see what it tells me when I press the tilde/backtick.

Just checking that you know that there is no backtick glyph in the default PicoMite fonts. Character 96 is always rendered as the degree symbol. That isn’t a keyboard issue it’s just a PicoMite font quirk.

Best wishes,

Tom

2 Likes
#define KEY_BACKSPACE   0x08 
#define KEY_TAB         0x09
#define KEY_ENTER       0x0A 
// 0x0D - CARRIAGE RETURN
#define KEY_BTN_LEFT2   0x11
#define KEY_BTN_RIGHT2  0x12


#define KEY_MOD_ALT     0xA1
#define KEY_MOD_SHL     0xA2
#define KEY_MOD_SHR     0xA3
#define KEY_MOD_SYM     0xA4
#define KEY_MOD_CTRL    0xA5

#define KEY_ESC       0xB1
#define KEY_UP        0xb5
#define KEY_DOWN      0xb6
#define KEY_LEFT      0xb4
#define KEY_RIGHT     0xb7

#define KEY_BREAK     0xd0 // == KEY_PAUSE
#define KEY_INSERT    0xD1
#define KEY_HOME      0xD2
#define KEY_DEL       0xD4
#define KEY_END       0xD5
#define KEY_PAGE_UP    0xd6
#define KEY_PAGE_DOWN  0xd7

#define KEY_CAPS_LOCK   0xC1

#define KEY_F1 0x81
#define KEY_F2 0x82
#define KEY_F3 0x83
#define KEY_F4 0x84
#define KEY_F5 0x85
#define KEY_F6 0x86
#define KEY_F7 0x87
#define KEY_F8 0x88
#define KEY_F9 0x89
#define KEY_F10 0x90 

everything else is according to standard ASCII (` is 0x60, ~ is 0x7e, etc ..)

2 Likes

This is just a guess, but picomite might be using a different i2c clock frequency. The software that came with the picocalc use 10kHz, which is well below the standard 100kHz and 400kHz. I’ve tried 100kHz in micropython and it does result in connection failure after a little while.

2 Likes

Here’s a new test build of WebMite for the Pico2(w) with the DEL key fix, and one other tweak in an effort to stop the keyboard disconnect:
http://ffauploads.com/WebMite_WEBRP2350_V6.00.02RC17a.uf2

The DEL key works, but as I was typing this (and planning to leave it on for a while) the keyboard not responding error happened, so it’s still there. I looked over the i2c code in PicoMite and saw one change that I didn’t think would matter – a redefinition of a variable that had been cleaned up. And I guess it didn’t matter. Something else is going on. I compared all the defined timeouts and those seemed to match up to guu’s build.

I’ll update the release builds with the DEL key fix soon.

Changes:

diff --git a/Editor.h b/Editor.h
index affa26a..50266e6 100644
--- a/Editor.h
+++ b/Editor.h
@@ -64,7 +64,11 @@ extern int editactive;
 #define LEFT      0x82
 #define RIGHT     0x83
 #define INSERT    0x84
+#ifdef PICOCALC
+#define DEL       0xd4
+#else
 #define DEL       0x7f
+#endif
 #define HOME      0x86
 #define END       0x87
 #define PUP       0x88
diff --git a/Hardware_Includes.h b/Hardware_Includes.h
index c122736..e04ff9e 100644
--- a/Hardware_Includes.h
+++ b/Hardware_Includes.h
@@ -328,7 +328,11 @@ extern struct tagMTRand *g_myrand;
 #define DOWNSEL     0xA1
 #define RIGHTSEL    0xA3
 #define INSERT		0x84
+#ifdef PICOCALC
+#define DEL			0xd4
+#else
 #define DEL			0x7f
+#endif
 #define HOME		0x86
 #define END			0x87
 #define PUP			0x88
diff --git a/I2C.c b/I2C.c
index 02cfd08..55952d8 100644
--- a/I2C.c
+++ b/I2C.c
@@ -77,7 +77,9 @@ static char *I2C2_Rcvbuf_String;										// pointer to the master receive buffe
 static unsigned int I2C2_Addr;										// I2C device address
 static volatile unsigned int I2C2_Sendlen;							// length of the master send buffer
 static volatile unsigned int I2C2_Rcvlen;							// length of the master receive buffer
-//static unsigned char I2C_Send_Buffer[256];                                   // I2C send buffer
+#ifdef PICOCALC
+static unsigned char I2C_Send_Buffer[256];                                   // I2C send buffer
+#endif
 bool  I2C2_enabled=false;									// I2C enable marker
 unsigned int I2C2_Timeout;									// master timeout value
 volatile unsigned int I2C2_Status;										// status flags

You don’t need anything other than BASIC to show the keycodes. Try the program below and press different keys. Ctrl-C or Shift Esc will stop the program:

DO
   A$=INKEY$
   IF A$<>"" THEN PRINT HEX$(ASC(A$))
LOOP

Not a problem for me. I find the degree symbol more useful than the back tick anyway.

So which is better? 10kHz or 100kHz - 400kHz? Does the original Pico2 software have a kb problem?

Here’s a table of changes to the PicoCalc keyboard.