rlutil icon indicating copy to clipboard operation
rlutil copied to clipboard

[osx catalina] kbhit count broken cannot get arrow keys

Open Zorgatone opened this issue 5 years ago • 3 comments

Tested on iTerm2.app and Terminal.app on OSX Catalina.

I couldn't get they arrow keys (Clang++ std=c++2a) using rlutil::getKey(). Multiple ANSI character sequences don't get handled properly because cnt variable is 0 and the ^[[A sequence in my game loop is split in multiple calls of rlutil::getKey()

As a result I never get rlutil::getKey() to equal rlutil::KEY_UP

Zorgatone avatar Apr 11 '20 16:04 Zorgatone

Also I get some deprecations on the IDE (CLion) with #include <sys/time.h> (deprecated header and suggets using ctime instead)

Zorgatone avatar Apr 11 '20 16:04 Zorgatone

I tried cloning the repo and building using the makefile and the test.cpp example still works with arrow_keys

Zorgatone avatar Apr 11 '20 16:04 Zorgatone

I got the arrows working by wrapping the update function of my game loop in an if(kbhit()) before the rlutil::getKey. I thought the rlutil::getKey already had a call to kbhit() without requiring an additional one, weird. Anyway with this if(kbhit()) the arrows work but the ENTER key does not :/

Zorgatone avatar Apr 11 '20 16:04 Zorgatone