diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-03-06 12:05:45 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-03-06 12:05:45 +0000 |
commit | 7cdc9feea1d8fcd016a842155c30308e4a0cae3d (patch) | |
tree | d5c731512d57f68043d03c0c9ff6095af508613e /winsup/cygwin/fhandler_console.cc | |
parent | cfc05d9675436a157ea959a5fb06da60722234c7 (diff) | |
download | cygnal-7cdc9feea1d8fcd016a842155c30308e4a0cae3d.tar.gz cygnal-7cdc9feea1d8fcd016a842155c30308e4a0cae3d.tar.bz2 cygnal-7cdc9feea1d8fcd016a842155c30308e4a0cae3d.zip |
* autoload.c (cygwin_premain0): Add missing parameter.
* binmode.c (cygwin_premain0): Ditto.
* textmode.c (cygwin_premain0): Ditto.
Patch contributed by Jason Tiller <jtiller@sjm.com> :
* auto_load.cc: Add "GetKeyboardLayout" entry in the list of
Win32 User32.DLL exports to provide.
* fhandler.h (class fhandler_console): Add meta_mask private
member to remember which keystroke modifiers should generate
META.
* fhandler_console.cc (fhandler_console::read): Modify code that
tests a keystroke for a META-escaped key to use the 'meta_mask'
variable.
(fhandler_console::fhandler_console): Add definition for
variable "meta_mask" used to determine if a keystroke should be
preceded by META in the client console stream. Set meta_mask
based on whether or not user's keyboard language is English -
non-English keyboards pass AltGr (right <ALT>) unmolested,
whereas English keyboards now interpret left- and right-<ALT>
as META.
Diffstat (limited to 'winsup/cygwin/fhandler_console.cc')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 6e8c76c1c..ca73ab651 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -250,7 +250,8 @@ fhandler_console::read (void *pv, size_t buflen) converting a CTRL-U. */ if ((unsigned char)ich > 0x7f && current_codepage == ansi_cp) OemToCharBuff (tmp + 1, tmp + 1, 1); - if (!(input_rec.Event.KeyEvent.dwControlKeyState & LEFT_ALT_PRESSED)) + /* Determine if the keystroke is modified by META. */ + if (!(input_rec.Event.KeyEvent.dwControlKeyState & meta_mask)) toadd = tmp + 1; else { @@ -790,6 +791,19 @@ fhandler_console::fhandler_console (const char *name) : dwLastButtonState = 0; nModifiers = 0; use_mouse = raw_win32_keyboard_mode = FALSE; + /* Set the mask that determines if an input keystroke is modified by + META. We set this based on the keyboard layout language loaded + for the current thread. The left <ALT> key always generates + META, but the right <ALT> key only generates META if we are using + an English keyboard because many "international" keyboards + replace common shell symbols ('[', '{', etc.) with accented + language-specific characters (umlaut, accent grave, etc.). On + these keyboards right <ALT> (called AltGr) is used to produce the + shell symbols and should not be interpreted as META. */ + meta_mask = LEFT_ALT_PRESSED; + if (PRIMARYLANGID (LOWORD (GetKeyboardLayout (0))) == LANG_ENGLISH) + meta_mask |= RIGHT_ALT_PRESSED; + set_need_fork_fixup (); } |