Article 5DW3B Do a function until a key is pressed.

Do a function until a key is pressed.

by
doom_23
from LinuxQuestions.org on (#5DW3B)
Hello. This is my first post here :)
I develop a little tool in C++ and I need to run some function while a key is pressed. I tried to use the getch() function and it works but if I am pressing a key, function calls 1 time, then I have wait until the "keyboard delay" will pass (I have 500ms delay in my xfce settings), and only then function will looped.
But how can I avoid this 500ms delay and immediately run a function?latest?d=yIl2AUoC8zA latest?i=KLURP5WlnVQ:rfZdXDaijMc:F7zBnMy latest?i=KLURP5WlnVQ:rfZdXDaijMc:V_sGLiP latest?d=qj6IDK7rITs latest?i=KLURP5WlnVQ:rfZdXDaijMc:gIN9vFwKLURP5WlnVQ
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments