aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-06-22 17:12:25 +0100
committerRon Yorston <rmy@pobox.com>2023-06-22 17:12:25 +0100
commit597d31eefb4a41abcf2d3c300c2b910b11a9f98c (patch)
treed80419df335c26d0e68c27148a0e48a0000198d6 /win32
parent7f23161e989ffc81edf89c2be3077757cc4fa4db (diff)
downloadbusybox-w32-597d31eefb4a41abcf2d3c300c2b910b11a9f98c.tar.gz
busybox-w32-597d31eefb4a41abcf2d3c300c2b910b11a9f98c.tar.bz2
busybox-w32-597d31eefb4a41abcf2d3c300c2b910b11a9f98c.zip
win32: make support for euro input a separate option
Commit 93a63809f (win32: add support for the euro currency symbol) made various changes to enable support for the euro symbol. One of these changes allows the euro to be entered from the console even if the current code page doesn't support it. This is probably of limited use: the symbol can be entered but won't be displayed correctly. Move this capability into a separate configuration option, FEATURE_EURO_INPUT, which is disabled by default. Saves 48-64 bytes in the new default case. (GitHub issue #335)
Diffstat (limited to 'win32')
-rw-r--r--win32/termios.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/win32/termios.c b/win32/termios.c
index 9fa97685d..081a41e5b 100644
--- a/win32/termios.c
+++ b/win32/termios.c
@@ -34,7 +34,7 @@ int64_t FAST_FUNC windows_read_key(int fd, char *buf UNUSED_PARAM, int timeout)
34 INPUT_RECORD record; 34 INPUT_RECORD record;
35 DWORD nevent_out, mode; 35 DWORD nevent_out, mode;
36 int ret = -1; 36 int ret = -1;
37#if ENABLE_FEATURE_EURO 37#if ENABLE_FEATURE_EURO_INPUT
38 wchar_t uchar; 38 wchar_t uchar;
39 char achar; 39 char achar;
40#endif 40#endif
@@ -54,7 +54,7 @@ int64_t FAST_FUNC windows_read_key(int fd, char *buf UNUSED_PARAM, int timeout)
54 if (WaitForSingleObject(cin, timeout) != WAIT_OBJECT_0) 54 if (WaitForSingleObject(cin, timeout) != WAIT_OBJECT_0)
55 goto done; 55 goto done;
56 } 56 }
57#if ENABLE_FEATURE_EURO 57#if ENABLE_FEATURE_EURO_INPUT
58 if (!ReadConsoleInputW(cin, &record, 1, &nevent_out)) 58 if (!ReadConsoleInputW(cin, &record, 1, &nevent_out))
59#else 59#else
60 if (!ReadConsoleInput(cin, &record, 1, &nevent_out)) 60 if (!ReadConsoleInput(cin, &record, 1, &nevent_out))
@@ -73,7 +73,7 @@ int64_t FAST_FUNC windows_read_key(int fd, char *buf UNUSED_PARAM, int timeout)
73 } 73 }
74 alt_pressed = state & LEFT_ALT_PRESSED; 74 alt_pressed = state & LEFT_ALT_PRESSED;
75 75
76#if ENABLE_FEATURE_EURO 76#if ENABLE_FEATURE_EURO_INPUT
77 if (!record.Event.KeyEvent.uChar.UnicodeChar) { 77 if (!record.Event.KeyEvent.uChar.UnicodeChar) {
78#else 78#else
79 if (!record.Event.KeyEvent.uChar.AsciiChar) { 79 if (!record.Event.KeyEvent.uChar.AsciiChar) {
@@ -119,7 +119,7 @@ int64_t FAST_FUNC windows_read_key(int fd, char *buf UNUSED_PARAM, int timeout)
119 ret &= ~0x80; 119 ret &= ~0x80;
120 goto done; 120 goto done;
121 } 121 }
122#if ENABLE_FEATURE_EURO 122#if ENABLE_FEATURE_EURO_INPUT
123 uchar = record.Event.KeyEvent.uChar.UnicodeChar; 123 uchar = record.Event.KeyEvent.uChar.UnicodeChar;
124 achar = uchar & 0x7f; 124 achar = uchar & 0x7f;
125 if (achar != uchar) 125 if (achar != uchar)