* fhandler.h (class dev_console): Add backspace_keycode member.

* fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
	backspace_keycode with CERASE.
	(fhandler_console::read): Return dev_state->backspace_keycode if the
	backspace key is pressed.
	(fhandler_console::char_command): Implement DECBKM escape sequence.
This commit is contained in:
Corinna Vinschen 2010-04-11 19:11:17 +00:00
parent e4f6022e52
commit 0250709234
3 changed files with 16 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2010-04-11 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (class dev_console): Add backspace_keycode member.
* fhandler_console.cc (fhandler_console::get_tty_stuff): Initialize
backspace_keycode with CERASE.
(fhandler_console::read): Return dev_state->backspace_keycode if the
backspace key is pressed.
(fhandler_console::char_command): Implement DECBKM escape sequence.
2010-04-10 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler_console.cc (fhandler_console::read): Default to sending

View File

@ -924,6 +924,7 @@ class dev_console
bool iso_2022_G1;
bool alternate_charset_active;
bool metabit;
char backspace_keycode;
char my_title_buf [TITLESIZE + 1];

View File

@ -118,6 +118,7 @@ fhandler_console::get_tty_stuff (int flags = 0)
if (PRIMARYLANGID (LOWORD (GetKeyboardLayout (0))) == LANG_ENGLISH)
dev_state->meta_mask |= RIGHT_ALT_PRESSED;
dev_state->set_default_attr ();
dev_state->backspace_keycode = CERASE;
shared_console_info->tty_min_state.sethwnd ((HWND) INVALID_HANDLE_VALUE);
}
@ -374,10 +375,9 @@ fhandler_console::read (void *pv, size_t& buflen)
if (control_key_state & LEFT_ALT_PRESSED)
dev_state->nModifiers |= 8;
/* Send the VERASE character from the terminal settings as backspace keycode. */
if (input_rec.Event.KeyEvent.wVirtualScanCode == 14)
{
char c = ti.c_cc[VERASE] ?: CERASE;
char c = dev_state->backspace_keycode;
nread = 0;
if (control_key_state & ALT_PRESSED) {
if (dev_state->metabit)
@ -1398,6 +1398,10 @@ fhandler_console::char_command (char c)
}
break;
case 67: /* DECBKM ("DEC Backarrow Key Mode") */
dev_state->backspace_keycode = (c == 'h' ? CTRL('H') : CERASE);
break;
case 1000: /* Mouse tracking */
dev_state->use_mouse = (c == 'h') ? 1 : 0;
syscall_printf ("mouse support set to mode %d", dev_state->use_mouse);