diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2006-07-03 15:29:10 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2006-07-03 15:29:10 +0000 |
commit | 6258d96af8a0181b81d5466d78fb4255f94de009 (patch) | |
tree | 9b9b6d456b8abd4653817a6dcc5f8c0c9588f768 /winsup/cygwin/fhandler_console.cc | |
parent | 61aea27d9002e491db5ea54a35cf3141843edcb9 (diff) | |
download | cygnal-6258d96af8a0181b81d5466d78fb4255f94de009.tar.gz cygnal-6258d96af8a0181b81d5466d78fb4255f94de009.tar.bz2 cygnal-6258d96af8a0181b81d5466d78fb4255f94de009.zip |
* fhandler.h (class dev_console): Add `metabit' indicating the
current meta key mode.
* fhandler_console.cc (fhandler_console::read): Set the top bit of
the character if metabit is true.
* fhandler_console.cc (fhandler_console::ioctl): Implement
KDGKBMETA and KDSKBMETA commands.
* fhandler_tty.cc (process_ioctl): Support KDSKBMETA.
(fhandler_tty_slave::ioctl): Send KDGKBMETA and KDSKBMETA to the
master.
* include/cygwin/kd.h: New file for the meta key mode.
* include/sys/kd.h: New file.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 7248e1747..82ede58cd 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -20,6 +20,7 @@ details. */ #include <winnls.h> #include <ctype.h> #include <sys/cygwin.h> +#include <cygwin/kd.h> #include "cygerrno.h" #include "security.h" #include "path.h" @@ -397,6 +398,11 @@ fhandler_console::read (void *pv, size_t& buflen) meta = (control_key_state & dev_state->meta_mask) != 0; if (!meta) toadd = tmp + 1; + else if (dev_state->metabit) + { + tmp[1] |= 0x80; + toadd = tmp + 1; + } else { tmp[0] = '\033'; @@ -745,6 +751,20 @@ fhandler_console::ioctl (unsigned int cmd, void *buf) case TIOCSWINSZ: bg_check (SIGTTOU); return 0; + case KDGKBMETA: + *(int *) buf = (dev_state->metabit) ? K_METABIT : K_ESCPREFIX; + return 0; + case KDSKBMETA: + if ((int) buf == K_METABIT) + dev_state->metabit = TRUE; + else if ((int) buf == K_ESCPREFIX) + dev_state->metabit = FALSE; + else + { + set_errno (EINVAL); + return -1; + } + return 0; case TIOCLINUX: if (* (int *) buf == 6) { |