I don't know whether this is only for me or everyone on Windows, but I think it is probably a problem that affects many users. And, its performance drawback is vary apparent to me.
I am using Windows 11, and it seems that illwill only tries to get mouse input in getKey() when it is on Windows.
However, this is making getKey() apparently slow on my computer, and not suitable for making keyboard inputs.
Behavior: Maybe the video. (In a nut, very slow and laggy.)
Solution: Maybe only try to get mouse input when gMouse is on?
proc getKey*(): Key =
## Reads the next keystroke in a non-blocking manner. If there are no
## keypress events in the buffer, `Key.None` is returned.
##
## If a mouse event was captured, `Key.Mouse` is returned. Call `getMouse()`
## to get tne details about the event.
##
## If the module is not intialised, `IllwillError` is raised.
checkInit()
result = getKeyAsync()
when defined(windows):
if gMouse and result == Key.None:
if hasMouseInput():
return Key.Mouse
When I do this edit on my local illwill, it makes my test program much faster.
I don't know whether this is only for me or everyone on Windows, but I think it is probably a problem that affects many users. And, its performance drawback is vary apparent to me. I am using Windows 11, and it seems that illwill only tries to get mouse input in getKey() when it is on Windows. However, this is making getKey() apparently slow on my computer, and not suitable for making keyboard inputs. Behavior: Maybe the video. (In a nut, very slow and laggy.) Solution: Maybe only try to get mouse input when gMouse is on?
When I do this edit on my local illwill, it makes my test program much faster.
Video: https://www.veed.io/view/d26c1418-680f-427b-9904-8c3e0d9eec34
When I force import getKeyAsync(), it is much faster too.