1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

Make ELinks more BSD console friendly

Conditionally define keys, such as DEL, when compiling on a system having
the BSD console system headers.

A combination of the changes:
	791cab91e7
	cfbe41aa8a
	fae675316b
This commit is contained in:
Jonas Fonseca 2006-11-27 18:18:06 +01:00
parent c38e8dc40b
commit e189a7e114

View File

@ -37,7 +37,6 @@
#include "util/string.h"
#include "util/time.h"
/* TODO: move stuff from here to itrm.{c,h} and mouse.{c,h} */
struct itrm *ditrm = NULL;
@ -636,6 +635,7 @@ get_esc_code(unsigned char *str, int len, unsigned char *code, int *num)
/* #define DEBUG_ITRM_QUEUE */
#ifdef DEBUG_ITRM_QUEUE
#include <stdio.h>
#include <ctype.h> /* isprint() isspace() */
#endif
@ -680,6 +680,19 @@ decode_terminal_escape_sequence(struct itrm *itrm, struct term_event *ev)
case 'H': kbd.key = KBD_HOME; break;
case 'I': kbd.key = KBD_PAGE_UP; break;
case 'G': kbd.key = KBD_PAGE_DOWN; break;
/* Free BSD */
/* case 'M': kbd.key = KBD_F1; break;*/
case 'N': kbd.key = KBD_F2; break;
case 'O': kbd.key = KBD_F3; break;
case 'P': kbd.key = KBD_F4; break;
case 'Q': kbd.key = KBD_F5; break;
/* case 'R': kbd.key = KBD_F6; break;*/
case 'S': kbd.key = KBD_F7; break;
case 'T': kbd.key = KBD_F8; break;
case 'U': kbd.key = KBD_F9; break;
case 'V': kbd.key = KBD_F10; break;
case 'W': kbd.key = KBD_F11; break;
case 'X': kbd.key = KBD_F12; break;
case 'z': switch (v) {
case 247: kbd.key = KBD_INS; break;
@ -757,12 +770,19 @@ set_kbd_event(struct term_event *ev, int key, int modifier)
case ASCII_TAB:
key = KBD_TAB;
break;
#if defined(HAVE_SYS_CONSIO_H) || defined(HAVE_MACHINE_CONSOLE_H) /* BSD */
case ASCII_BS:
key = KBD_BS;
break;
case ASCII_DEL:
key = KBD_DEL;
break;
#else
case ASCII_BS:
case ASCII_DEL:
key = KBD_BS;
break;
#endif
case ASCII_LF:
case ASCII_CR:
key = KBD_ENTER;