开发者

How can I modify the keyboard repeat delay in a linux console, with or without ncurses

开发者 https://www.devze.com 2023-01-05 16:48 出处:网络
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

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 ke开发者_运维问答y 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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消