parent
67ac1aef59
commit
6cf8a72d49
1 changed files with 4 additions and 1 deletions
|
|
@ -634,6 +634,9 @@ proc getch*(): char =
|
|||
doAssert(readConsoleInput(fd, addr(keyEvent), 1, addr(numRead)) != 0)
|
||||
if numRead == 0 or keyEvent.eventType != 1 or keyEvent.bKeyDown == 0:
|
||||
continue
|
||||
if keyEvent.uChar == 0:
|
||||
return char(keyEvent.wVirtualKeyCode)
|
||||
else:
|
||||
return char(keyEvent.uChar)
|
||||
else:
|
||||
let fd = getFileHandle(stdin)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue