Thanks for your help guys. Unfortunately I couldn't get my_getch() working today (some issues with termios.h on the remote platform) which was a shame as it is a nice solution. I'm not back at work...
Type: Posts; User: Ad_robot
Thanks for your help guys. Unfortunately I couldn't get my_getch() working today (some issues with termios.h on the remote platform) which was a shame as it is a nice solution. I'm not back at work...
Thanks anduril, that example certainly works, though curses seems to make the rest of my program behave quite strangely. As I mentioned this is a modification to a large, exisiting bit of code.
I...
tabstop,
Unfortunately the other system doesn't have a keyboard, mouse or display, it's an embedded platform connected to some sensors and actuators.
The strange thing is that getchar() does...
Aargh, but getchar() detects keys fine! So it's not the remote interface...
Btw, I just checked and ERR is '-1'.
I put this in my while loop
But even if I hold down a key and make usleep very small, getch = '-1'. Interesting... it seems that my keystrokes aren't...
Thanks for the suggestions.
tabstop I've made the chr an integer but I still get the same response.
Sipher I've reduced usleep to 50 and also taken it out completely but the same response...
Hi,
I used ERR as this seemed to have been used in the code I've been using as an example. I believed that the statement would return ERR if nothing had been pressed. Is this not a good choice?
...
Hi,
The while loop keeps printing '. ' so it isn't blocking. I assume that means no-delay is true (though I haven't set this explicitly I believe that it is the default).
If i press enter I...
Hi,
I'm trying to write a while loop that is able to recognise and act on keyboard presses without pausing to wait for an input (unlike getchar()).
At the moment I'm just trying to detect any...