linux - detect automatic key-repeats in curses -
i'm writing little text mode application using curses on linux.
for keyboard input use curses functions. key auto-repeats work, e.g. if hold key down multiple key events until release key again.
is possible distinguish between real key events , generated key repeat logic?
background: application little data-entry front-end user can modify integer numbers of parameters. in long run application work without standard keyboard. have 4 buttons data-entry: 'increase', 'decrease', 'ok' , 'cancel'.
since number ranges large i'd know if user holds down key. if can scan faster through numeric range not incrementing number 1 10 or maybe 100. if user otoh taps key input method should precise again , increase/decrease numbers one.
is possible keyboard input functions of curses?
no - curses receives keys terminal. if need try find out if key repeats automated or not looking @ delay between each keypress. however, on remote connections, might not solution delay affected network latency.
the best solution might using up/down small steps , pageup/pagedown large steps.
Comments
Post a Comment