5

I'm writing a little pong clone with ncurses and C. I need to find a way to set the keyboard repeat delay to make it easier for a player to move the paddle, otherwise they are stuck hitting the down key and waiting about 50 milliseconds until the key begins to repeat.

I've checked the ncurses man pages and documentation, and I can't seem to find any reference to changing keyboard repeat delays, also the program kbdrate is not suitable for my use, because it would be a bit strange for a game to ask to be run as root.

Thanks, Emmanuel

xavieran
  • 53
  • 6

1 Answers1

0

How about capturing the keydown and the repeatedly checking to see if the key is up yet?

Anthony
  • 12,177
  • 9
  • 69
  • 105
  • Good idea, from looking at this thread http://stackoverflow.com/questions/1409216/receiving-key-press-and-key-release-events-in-linux-terminal-applications it looks like it might take some work, but it should be doable. – xavieran Jul 02 '10 at 04:58
  • Great. I remember this is how I solved this problem in the past. – Anthony Jul 02 '10 at 05:05
  • 1
    Curses does not have keydown/keyup events. That's at a much lower io layer than the terminal. – R.. GitHub STOP HELPING ICE Jul 03 '10 at 15:02