Catalina keyboard question
Devin Frioud
Posts: 17
Hello,
I'm getting started with Catalina C, and I was wondering about the function k_get();
does it return the key pressed?
Or some other value?
And does it return strings?
Or characters?
Any help would be appreciated.
Devin
I'm getting started with Catalina C, and I was wondering about the function k_get();
does it return the key pressed?
Or some other value?
And does it return strings?
Or characters?
Any help would be appreciated.
Devin
Comments
Just be aware that there are some issues with cr and lf. Sometimes they block input or output until you include the cr or crlf. I think it is most likely the way C works and am not a C programmer.
Perhaps Ross will chime in. He has been rather unwell recently so he has not been active much on the forum.
The k_get() functon returns an int that represents a keypress. You can think of the results as a character converted to an int.
This function does not return strings. You can build your own string up one character at a time by calling k_get() repeatedly, or use the stdio functions instead.
There is a test program called test_key.c in the demos directory that demonstrates k_get().
Ross.