diff options
author | Christopher Faylor <me@cgf.cx> | 2003-04-08 21:19:33 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-04-08 21:19:33 +0000 |
commit | ca81cd60ce99479828fefb3343267255fd47771c (patch) | |
tree | f1842d856221f8664ebe7abffe27083e1d8fa5ec /winsup/cygwin | |
parent | e3501c78cad9d0a94e9004d4cfc40fe3c783549f (diff) | |
download | cygnal-ca81cd60ce99479828fefb3343267255fd47771c.tar.gz cygnal-ca81cd60ce99479828fefb3343267255fd47771c.tar.bz2 cygnal-ca81cd60ce99479828fefb3343267255fd47771c.zip |
* fhandler_console.cc (fhandler_console::read) Handle certain key up events, to
allow pasting accented characters and typing them using the "alt + numerics"
sequences.
* include/limits.h (IOV_MAX): Set to a number which is small enough to use in
an array.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 11 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 18 | ||||
-rw-r--r-- | winsup/cygwin/include/limits.h | 4 |
3 files changed, 28 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index ba78f9b7f..6d4972be4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +2003-04-08 Bob Cassels <bcassels@abinitio.com> + + * fhandler_console.cc (fhandler_console::read) Handle certain key up + events, to allow pasting accented characters and typing them using the + "alt + numerics" sequences. + +2003-04-07 Christopher Faylor <cgf@redhat.com> + + * include/limits.h (IOV_MAX): Set to a number which is small enough to + use in an array. + 2003-04-04 Christopher Faylor <cgf@redhat.com> * cygthread.h (cygthread::avail): Make LONG for easier use with diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 768327056..26fa64d44 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -321,14 +321,26 @@ fhandler_console::read (void *pv, size_t& buflen) break; } - if (!input_rec.Event.KeyEvent.bKeyDown) - continue; - #define ich (input_rec.Event.KeyEvent.uChar.AsciiChar) #define wch (input_rec.Event.KeyEvent.uChar.UnicodeChar) #define ALT_PRESSED (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED) #define CTRL_PRESSED (LEFT_CTRL_PRESSED | RIGHT_CTRL_PRESSED) + /* Ignore key up events, except for left alt events with non-zero character + */ + if (!input_rec.Event.KeyEvent.bKeyDown && + /* + Event for left alt, with a non-zero character, comes from + "alt + numerics" key sequence. + e.g. <left-alt> 0233 => é + */ + !(wch != 0 + // ?? experimentally determined on an XP system + && virtual_key_code == VK_MENU + // left alt -- see http://www.microsoft.com/hwdev/tech/input/Scancode.asp + && input_rec.Event.KeyEvent.wVirtualScanCode == 0x38)) + continue; + if (wch == 0 || /* arrow/function keys */ (input_rec.Event.KeyEvent.dwControlKeyState & ENHANCED_KEY)) diff --git a/winsup/cygwin/include/limits.h b/winsup/cygwin/include/limits.h index 78c475170..9fa3cf4fe 100644 --- a/winsup/cygwin/include/limits.h +++ b/winsup/cygwin/include/limits.h @@ -116,9 +116,9 @@ details. */ #define ULLONG_MAX (LLONG_MAX * 2ULL + 1) #endif -/* Maximum number of iovcnt in a writev */ +/* Maximum number of iovcnt in a writev (an arbitrary number) */ #undef IOV_MAX -#define IOV_MAX (__INT_MAX__-1) +#define IOV_MAX 1024 /* Maximum size of ssize_t */ #undef SSIZE_MAX |