Rearranged key commands

Rearranged the key commands:

ctrl-c (clear screen) is now
ctrl-l which is similar to the well known shell ctrl-l

ctrl-i (show settings information) is now
ctrl-c (show configuration)

Updated man page accordingly.
This commit is contained in:
Martin Lund 2016-06-04 21:56:53 +02:00
parent b9a2f4a1be
commit a64d1a493b
3 changed files with 14 additions and 14 deletions

View file

@ -71,9 +71,9 @@ In session, the following key sequences are intercepted as tio commands:
.IP "\fBctrl-t ?" .IP "\fBctrl-t ?"
List available key commands List available key commands
.IP "\fBctrl-t c" .IP "\fBctrl-t c"
Show configuration (baudrate, databits, etc.)
.IP "\fBctrl-t l"
Clear screen Clear screen
.IP "\fBctrl-t i"
Show settings information (baudrate, databits, etc.)
.IP "\fBctrl-t q" .IP "\fBctrl-t q"
Quit Quit
.IP "\fBctrl-t s" .IP "\fBctrl-t s"

View file

@ -24,7 +24,7 @@
#define KEY_QUESTION 0x3f #define KEY_QUESTION 0x3f
#define KEY_C 0x63 #define KEY_C 0x63
#define KEY_I 0x69 #define KEY_L 0x6C
#define KEY_Q 0x71 #define KEY_Q 0x71
#define KEY_S 0x73 #define KEY_S 0x73
#define KEY_T 0x74 #define KEY_T 0x74

View file

@ -81,19 +81,15 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
case KEY_QUESTION: case KEY_QUESTION:
tio_printf("Key commands:"); tio_printf("Key commands:");
tio_printf(" ctrl-t ? List available key commands"); tio_printf(" ctrl-t ? List available key commands");
tio_printf(" ctrl-t c Clear screen"); tio_printf(" ctrl-t c Show configuration");
tio_printf(" ctrl-t i Show settings information"); tio_printf(" ctrl-t l Clear screen");
tio_printf(" ctrl-t q Quit"); tio_printf(" ctrl-t q Quit");
tio_printf(" ctrl-t s Show statistics"); tio_printf(" ctrl-t s Show statistics");
tio_printf(" ctrl-t t Send ctrl-t key code"); tio_printf(" ctrl-t t Send ctrl-t key code");
*forward = false; *forward = false;
break; break;
case KEY_C: case KEY_C:
status = system("clear"); tio_printf("Configuration:");
*forward = false;
break;
case KEY_I:
tio_printf("Settings information:");
tio_printf(" TTY device: %s", option.tty_device); tio_printf(" TTY device: %s", option.tty_device);
tio_printf(" Baudrate: %u", option.baudrate); tio_printf(" Baudrate: %u", option.baudrate);
tio_printf(" Databits: %d", option.databits); tio_printf(" Databits: %d", option.databits);
@ -105,19 +101,23 @@ void handle_command_sequence(char input_char, char previous_char, char *output_c
tio_printf(" Log file: %s", option.log_filename); tio_printf(" Log file: %s", option.log_filename);
*forward = false; *forward = false;
break; break;
case KEY_L:
status = system("clear");
*forward = false;
break;
case KEY_Q: case KEY_Q:
/* Exit upon ctrl-t q sequence */ /* Exit upon ctrl-t q sequence */
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
case KEY_T:
/* Send ctrl-t key code upon ctrl-t t sequence */
*output_char = KEY_CTRL_T;
break;
case KEY_S: case KEY_S:
/* Show tx/rx statistics upon ctrl-t s sequence */ /* Show tx/rx statistics upon ctrl-t s sequence */
tio_printf("Statistics:"); tio_printf("Statistics:");
tio_printf(" Sent %lu bytes, received %lu bytes", tx_total, rx_total); tio_printf(" Sent %lu bytes, received %lu bytes", tx_total, rx_total);
*forward = false; *forward = false;
break; break;
case KEY_T:
/* Send ctrl-t key code upon ctrl-t t sequence */
*output_char = KEY_CTRL_T;
break;
default: default:
/* Ignore unknown ctrl-t escaped keys */ /* Ignore unknown ctrl-t escaped keys */
*forward = false; *forward = false;