| bievis (3) | |
|
Hi everybody, i'm developing a small terminal simulator, and I need to capture a string and special keys at same time but i'm not able to capture these special keys. Overall I need capture arrow keys to use them how history (equal to a bash terminal). For the capture string i use mvwaddstr() function. Any suggestion will be welcome. Best regards. | |
|
|
|
| codewalker (159) | |
|
Special keys are returned by wgetch() itself they are defined in curses.h the keys are defined as KEY_BREAK, KEY_DOWN, KEY_UP etc. To use this you need to enable "keypad" like keyed( window_name, TRUE ); For more info you can "man getch" and "man keypad", if you are on Windows then try http://man.he.net | |
|
|
|
| bievis (3) | |
|
First, thanks for the reply And second, I seem rare than it doesn't exists a solution to unify the capture of a string and these special keys. So if I wanted to do this there is only one way and this is create a parser of messages with wgetch(), char by char. That lazy! ;( Best regards. ;) | |
|
|
|