diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-08-23 21:34:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-23 21:34:22 +0200 |
commit | 547fcd69c3a689b7db8dc3e462659b71f791ab46 (patch) | |
tree | da415889ffe6405f926e9c37f6e02ebf8e11b312 /lib | |
parent | c3c583932966849b4eba2d2ffad20ea60e2f5cb2 (diff) | |
download | Nim-547fcd69c3a689b7db8dc3e462659b71f791ab46.tar.gz |
rdstdin: remove cruft that shouldn't have been exported or added (#12014)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/impure/rdstdin.nim | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/lib/impure/rdstdin.nim b/lib/impure/rdstdin.nim index 742db0cc6..b78c0d8cf 100644 --- a/lib/impure/rdstdin.nim +++ b/lib/impure/rdstdin.nim @@ -33,46 +33,6 @@ when defined(Windows): stdout.write(prompt) result = readLine(stdin, line) - import winlean - - const - VK_SHIFT* = 16 - VK_CONTROL* = 17 - VK_MENU* = 18 - KEY_EVENT* = 1 - - type - KEY_EVENT_RECORD = object - bKeyDown: WINBOOL - wRepeatCount: uint16 - wVirtualKeyCode: uint16 - wVirtualScanCode: uint16 - unicodeChar: uint16 - dwControlKeyState: uint32 - INPUT_RECORD = object - eventType*: int16 - reserved*: int16 - event*: KEY_EVENT_RECORD - safetyBuffer: array[0..5, DWORD] - - proc readConsoleInputW*(hConsoleInput: Handle, lpBuffer: var INPUT_RECORD, - nLength: uint32, - lpNumberOfEventsRead: var uint32): WINBOOL{. - stdcall, dynlib: "kernel32", importc: "ReadConsoleInputW".} - - proc getch(): uint16 = - let hStdin = getStdHandle(STD_INPUT_HANDLE) - var - irInputRecord: INPUT_RECORD - dwEventsRead: uint32 - - while readConsoleInputW(hStdin, irInputRecord, 1, dwEventsRead) != 0: - if irInputRecord.eventType == KEY_EVENT and - irInputRecord.event.wVirtualKeyCode notin {VK_SHIFT, VK_MENU, VK_CONTROL}: - result = irInputRecord.event.unicodeChar - discard readConsoleInputW(hStdin, irInputRecord, 1, dwEventsRead) - return result - elif defined(genode): proc readLineFromStdin*(prompt: string): TaintedString {. tags: [ReadIOEffect, WriteIOEffect].} = |