diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-22 09:43:03 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-22 09:43:03 +1000 |
commit | 6e1050c254353471131672c0e8383c9e906d6fb5 (patch) | |
tree | a2586ceae2ab36c54e60cb4c69527d588c0e3a8e /win32 | |
parent | 1245a2ba817045d0a33baa5c86b69e54596b9199 (diff) | |
download | busybox-w32-6e1050c254353471131672c0e8383c9e906d6fb5.tar.gz busybox-w32-6e1050c254353471131672c0e8383c9e906d6fb5.tar.bz2 busybox-w32-6e1050c254353471131672c0e8383c9e906d6fb5.zip |
win32: lineedit: make read_key() pass Ctrl+<letter> to read_line_input
This makes ^C and ^D work properly regarding ash input handling
(i.e. does not crash ash). Pressing ^C in ash does not stop running
programs though.
Diffstat (limited to 'win32')
-rw-r--r-- | win32/termios.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/win32/termios.c b/win32/termios.c index e2dc96361..34a17bbfd 100644 --- a/win32/termios.c +++ b/win32/termios.c | |||
@@ -31,6 +31,12 @@ int64_t FAST_FUNC read_key(int fd, char *buf, int timeout UNUSED_PARAM) | |||
31 | continue; | 31 | continue; |
32 | if (!record.Event.KeyEvent.uChar.AsciiChar) { | 32 | if (!record.Event.KeyEvent.uChar.AsciiChar) { |
33 | DWORD state = record.Event.KeyEvent.dwControlKeyState; | 33 | DWORD state = record.Event.KeyEvent.dwControlKeyState; |
34 | |||
35 | if (state & (RIGHT_CTRL_PRESSED|LEFT_CTRL_PRESSED) && | ||
36 | (record.Event.KeyEvent.wVirtualKeyCode >= 'A' && | ||
37 | record.Event.KeyEvent.wVirtualKeyCode <= 'Z')) | ||
38 | return record.Event.KeyEvent.wVirtualKeyCode & ~0x40; | ||
39 | |||
34 | switch (record.Event.KeyEvent.wVirtualKeyCode) { | 40 | switch (record.Event.KeyEvent.wVirtualKeyCode) { |
35 | case VK_DELETE: return KEYCODE_DELETE; | 41 | case VK_DELETE: return KEYCODE_DELETE; |
36 | case VK_INSERT: return KEYCODE_INSERT; | 42 | case VK_INSERT: return KEYCODE_INSERT; |