views:

24

answers:

1

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 :D

Thanks, Emmanuel

A: 

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

Duracell
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
Great. I remember this is how I solved this problem in the past.
Duracell
Curses does not have keydown/keyup events. That's at a much lower io layer than the terminal.
R..