I am using C++ and ncurses to get key input for a game. I have a moveable object that the arrow keys control. The behavior that I want is to be able to constantly move right with an arrow key and jump with the up keyy without interrupting the moving right. However, currently with ncurses, when RIGHT is being held and UP is pressed, it stops registering that RIGHT is being held, and you have to release and press RIGHT again.
How can I fix this? I have seen this post, which is how I'm getting the multiple key input (see below), however I don't think this is the problem.
while (gameRunning) {
int ch;
vector<int> keys;
while ((ch == getch()) != ERR) {
keys.push_back(ch);
// keys vector now has all pressed keys,
// however if you are holding right and up is pressed,
// holding right is not recognized until you release and
// right is pressed again
}
// loop through keys vector here, do things with pressed keys
}