Shop OBEX P1 Docs P2 Docs Learn Events
Catalina keyboard question — Parallax Forums

Catalina keyboard question

Devin FrioudDevin Frioud Posts: 17
edited 2013-07-28 22:05 in Propeller 1
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

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2013-07-17 17:18
    Devin: Welcome. Unfortunately I cannot recall. I suggest you give it a try. There are plenty of sample programs including the traditional hello and its extensions.
    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.
  • RossHRossH Posts: 5,462
    edited 2013-07-28 20:59
    Hi Devin,

    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.
  • Devin FrioudDevin Frioud Posts: 17
    edited 2013-07-28 22:05
    Thanks Ross!
Sign In or Register to comment.