1
0
mirror of https://github.com/rricharz/Tek4010.git synced 2026-05-20 04:27:36 +00:00

-eraseBS and -eraseDEL added

This commit is contained in:
Rene Richarz
2026-05-10 06:37:13 +02:00
parent 7712a68649
commit 2c2d42557d
7 changed files with 38 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -82,6 +82,17 @@ Use -noAutoClear to disable this.
| -half | Use half of the screen width. |
| -b9600… | Emulate terminal baud rates |
Some historical systems expect BS (^H, 0x08) as the erase character,
while others expect DEL (^?, 0x7F).
If the Backspace/Delete key does not work correctly, try:
tek4010 -eraseBS
or
tek4010 -eraseDEL
---
More options and detailed information, including

View File

@@ -89,6 +89,9 @@ guint global_timeout_ref;
extern int tube_doClearPersistent;
#define ERASE_BS 0x08
#define ERASE_DEL 0x7F
static void do_drawing(cairo_t *, GtkWidget *);
long now_msec(void)
@@ -299,6 +302,12 @@ static void on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_da
}
}
// Backspace/Delete/Rubout key
else if ((event->keyval == 0xFF08) || // Backspace
(event->keyval == 0xFFFF)) { // Delete/Rubout
ch = argEraseChar;
}
// exit on ctrl-c if child has exited
if (childExited &&
(event->state & GDK_CONTROL_MASK) && (event->keyval == 0x0064)) {
@@ -310,7 +319,7 @@ static void on_key_press(GtkWidget *widget, GdkEventKey *event, gpointer user_da
else if ((event->keyval >= 0xFF00) && (event->keyval <= 0xFF1F))
ch = event->keyval & 0x1F;
// ctrl-letter keys: pass through as ASCII control characters
// ctrl-letter keys: pass through as ASCII control characters
else if (event->state & GDK_CONTROL_MASK)
ch = event->keyval & 0x1F;

View File

@@ -122,6 +122,9 @@ int aplMode = 0;
pid_t childPid = -1;
int argPty = 0;
#define ERASE_BS 0x08
#define ERASE_DEL 0x7F
int argEraseChar = ERASE_BS;
int tube_x0, tube_x2,tube_y0, tube_y2;
@@ -394,7 +397,7 @@ void tube_init(int argc, char* argv[])
int ptyMaster = -1;
argAutoClear = 1;
argNoexit = 1;
printf("tek4010 version 2.0\n");
printf("tek4010 version 2.0.1\n");
windowName = "Tektronix 4010/4014 emulator";
if (argc > 19) {
printf("Error: Too many arguments\n");
@@ -481,6 +484,12 @@ void tube_init(int argc, char* argv[])
argHalf = 1;
else if (strcmp(argv[firstArg],"-escdebug") == 0)
argEscDebug = 1;
else if (strcmp(argv[firstArg],"-eraseBS") == 0)
argEraseChar = ERASE_BS;
else if (strcmp(argv[firstArg],"-eraseDEL") == 0)
argEraseChar = ERASE_DEL;
else {
printf("tek4010: unknown argument %s\n", argv[firstArg]);
exit(1);
@@ -566,7 +575,7 @@ void tube_init(int argc, char* argv[])
tio.c_lflag &= ~ECHOCTL;
#endif
tio.c_lflag |= ECHOE;
tio.c_cc[VERASE] = 0x08;
tio.c_cc[VERASE] = argEraseChar;
tcsetattr(STDIN_FILENO, TCSANOW, &tio);
}

View File

@@ -55,6 +55,8 @@ extern int tube_x0, tube_x2, tube_y0, tube_y2;
extern double pensize;
extern int argEraseChar;
extern long tube_mSeconds();
extern long tube_u100ResetSeconds(int reset);
extern int tube_translateKeyCode(int ch);

View File

@@ -1,3 +1,7 @@
Version 2.0.1 April 9, 2026
===========================
added -eraseBS and -eraseDEL options
Version 2.0 April 9, 2026
=========================
Terminal mode added. Improved timing.