PRIVATE char numpad_map[] =
{'H', 'Y', 'A', 'B', 'D', 'C', 'V', 'U', 'G', 'S', 'T', '@'};
+PRIVATE char *fkey_map[] =
+ {"11", "12", "13", "14", "15", "17", /* F1-F6 */
+ "18", "19", "20", "21", "23", "24"}; /* F7-F12 */
+
/* Variables and definition for observed function keys. */
typedef struct observer { int proc_nr; int events; } obs_t;
PRIVATE obs_t fkey_obs[12]; /* observers for F1-F12 */
PRIVATE int kbd_watchdog_set= 0;
PRIVATE int kbd_alive= 1;
-PRIVATE int sticky_alt_mode = 0;
+PRIVATE long sticky_alt_mode = 0;
+PRIVATE long debug_fkeys = 1;
PRIVATE timer_t tmr_kbd_wd;
FORWARD _PROTOTYPE( void handle_req, (struct kbd *kbdp, message *m) );
int try;
{
/* Process characters from the circular keyboard buffer. */
- char buf[3];
+ char buf[7], *p, suffix;
int scode;
unsigned ch;
if (itail == ibuf + KB_IN_BYTES) itail = ibuf;
icount--;
- /* Function keys are being used for debug dumps. */
- if (func_key(scode)) continue;
+ /* Function keys are being used for debug dumps (if enabled). */
+ if (debug_fkeys && func_key(scode)) continue;
/* Perform make/break processing. */
ch = make_break(scode);
buf[2] = numpad_map[ch - HOME];
(void) in_process(tp, buf, 3);
} else
+ if ((F1 <= ch && ch <= F12) || (SF1 <= ch && ch <= SF12) ||
+ (CF1 <= ch && ch <= CF12 && !debug_fkeys)) {
+ /* An escape sequence generated by function keys. */
+ if (F1 <= ch && ch <= F12) {
+ ch -= F1;
+ suffix = 0;
+ } else
+ if (SF1 <= ch && ch <= SF12) {
+ ch -= SF1;
+ suffix = '2';
+ } else
+ if (CF1 <= ch && ch <= CF12) {
+ ch -= CF1;
+ suffix = shift ? '6' : '5';
+ }
+ /* ^[[11~ for F1, ^[[24;5~ for CF12 etc */
+ buf[0] = ESC;
+ buf[1] = '[';
+ buf[2] = fkey_map[ch][0];
+ buf[3] = fkey_map[ch][1];
+ p = &buf[4];
+ if (suffix) {
+ *p++ = ';';
+ *p++ = suffix;
+ }
+ *p++ = '~';
+ (void) in_process(tp, buf, p - buf);
+ } else
if (ch == ALEFT) {
/* Choose lower numbered console as current console. */
select_console(ccurrent - 1);
{
int i;
u8_t ccb;
- char env[100];
- if(env_get_param("sticky_alt", env, sizeof(env)-1) == OK
- && atoi(env) == 1) {
- sticky_alt_mode = 1;
- }
+ env_parse("sticky_alt", "d", 0, &sticky_alt_mode, 0, 1);
+ env_parse("debug_fkeys", "d", 0, &debug_fkeys, 0, 1);
set_leds(); /* turn off numlock led */
scan_keyboard(NULL, NULL); /* discard leftover keystroke */
:kb=^H:kd=^J:kl=^H:kr=^L:ku=^K:le=^H:nd=^L:nl=^J:se=\Ek:\
:so=\Ej:st=\E1:ue=\Em:up=^K:us=\El:
-#### Console types for obsolete UNIX clones
+#### Console types for obsolete and not-so-obsolete UNIX clones
#
# Coherent, Minix, Venix, and several lesser-known kin were OSs for 8088
# machines that tried to emulate the UNIX look'n'feel. Coherent and Venix
# even as single processes under SunOS and the Macintosh OS.
#
-# This is the entry provided with minix 1.7.4, with bogus :ri: removed.
-minix|minix console (v1.7):\
- :am:xn:\
+# This is the entry provided with MINIX 3.1.6.
+minix|minix console:\
+ :am:xn:bs:\
:co#80:it#8:li#25:\
:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:IC=\E[%d@:\
:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:al=\E[L:bl=^G:cd=\E[0J:\
:ce=\E[K:cl=\E[H\E[0J:cm=\E[%i%d;%dH:cr=^M:dc=\E[P:\
- :dl=\E[M:do=\E[B:ei=:ho=\E[H:ic=\E[@:im=:is=\E[0m:k0=\E[Y:\
- :k1=\E[V:k2=\E[U:k3=\E[T:k4=\E[S:k5=\E[G:kb=^H:kd=\E[B:\
- :kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:l0=End:l1=PgUp:l2=PgDn:\
- :l3=Num +:l4=Num -:l5=Num 5:le=^H:mb=\E[5m:md=\E[1m:\
- :me=\E[0m:mr=\E[7m:nd=\E[C:nw=^M^J:se=\E[0m:sf=^J:so=\E[7m:\
- :sr=\EM:ta=^I:ue=\E[0m:up=\E[A:us=\E[4m:
+ :dl=\E[M:do=\E[B:ho=\E[H:ic=\E[@:is=\E[0m:k1=\E[11~:\
+ :k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:k6=\E[17~:\
+ :k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kD=\177:\
+ :kI=\E[@:kN=\E[U:kP=\E[V:kb=^H:kd=\E[B:kh=\E[H:kl=\E[D:\
+ :kr=\E[C:ku=\E[A:le=^H:mb=\E[5m:md=\E[1m:me=\E[0m:\
+ :mr=\E[7m:nd=\E[C:nw=^M^J:se=\E[0m:sf=^J:so=\E[7m:\
+ :sr=\EM:ta=^I:ue=\E[0m:up=\E[A:us=\E[4m:@7=\E[Y:\
+ :Co#8:pa#64:AB=\E[4%dm:AF=\E[3%dm:
# Corrected Jan 14, 1997 by Vincent Broman <broman@nosc.mil>
minix-old|minix console (v1.5):\
:xo:\