MiguelVis / te

Text editor for the CP/M operating system and related computers: Amstrad PCW, CPC, Kaypro, Spectrum...
GNU General Public License v2.0
83 stars 10 forks source link

Control codes >128 #15

Open hcsaustrup opened 2 months ago

hcsaustrup commented 2 months ago

Hi!

I'm working on a configuration for the Enterprise running IS-DOS, and I've run into a minor issue; am I right in assuming that you can't specify control/navigation codes above 127? I believe the delete-right code produced on the Enterprise is 160, so I'm not sure how to specify that in the .cf file.

Regards, HC

MiguelVis commented 1 month ago

Hi @hcsaustrup.

Valid values for control characters are:

# Legal control characters are:
# ^A..^Z ^[ ^\ ^] ^^ ^_ -> 1..31
# ^?                    -> 127

Anyway, you could modify the CrtIn() function in the adaptation file you are using as follows:

/* Input character from the keyboard
   ---------------------------------
   All program input is done with this function.

   Translate some key bindings.

   int CrtIn(void)
*/
CrtIn()
{
    int ch;

    switch(ch = CrtInEx()) {
        case 160 :   /* 160 == DEL */
            return DEL;
    }

    return ch;
}

So TE will translate 160 dec into 127 dec and the ini file should read:

key.right = "^?"

You could use any other character control for translation if desired.

Tell me if that solves the issue.