How to detect keyboard key depression

I am trying to detect when a key is depressed, while running in a continuous loop. It is essential that this process is non blocking, but so far I have tried about 4 different libraries or suggestions, and they are all blocking! Given how easily Go does some relatively complex things, it seems unbelievable how a seemingly simple task such as detecting when I press Q to quit is so difficult to do.

PS. Back in the 80’s my Commodore VIC-20 could achieve this using only 2 lines of code:
get K$
if K$ = “Q” then end

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.