Skip to content

Commit

Permalink
Another rlutil patch
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmarius committed Aug 20, 2022
1 parent 5db25cf commit e7f0b94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ext/include/rlutil/rlutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ enum {
/// Note:
/// Only Arrows, Esc, Enter and Space are currently working properly.
RLUTIL_INLINE int getkey(void) {
#if defined(GITHUB_ACTIONS) && defined(_WIN32)
return getchar();
#else // GITHUB_ACTIONS
#ifndef _WIN32
int cnt = kbhit(); // for ANSI escapes processing
#endif
Expand Down Expand Up @@ -422,6 +425,7 @@ RLUTIL_INLINE int getkey(void) {
#endif // _WIN32
default: return k;
}
#endif // GITHUB_ACTIONS
}

/// Function: nb_getch
Expand Down
1 change: 1 addition & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ int main() {

std::cout << "-----------------------------------------------\n";

rlutil::saveDefaultColor();
rlutil::setColor(rlutil::BLUE);
rlutil::cls();
int key = rlutil::getkey(); // apel blocant; apelează kbhit și getch
Expand Down

0 comments on commit e7f0b94

Please sign in to comment.