KeyCBC - Keyboard Input for you programs.

No replies
catron
catron's picture
Title: ZoomBot
Joined: 06/02/2009
Posts:
BotPoints: 98
User offline. Last seen 11 years 14 weeks ago.

There was a talk on the irc channel about using USB keyboards, so I have wipped up a header to do just that. It is GPLed, but as always I grant you the right to statically and dynamically link to it for closed source robots. If you modify the header however, you have to share your modifications to the header with us.
KeyCBC Repository

Test program that prompts for a user's name and then prints it back:

  1. int main(int argc, char* argv)
  2. {
  3. // Make sure we clean up
  4. atexit(closeKeyboard);
  5. // Open the keyboard for use
  6. if (openKeyboard() == FALSE)
  7. {
  8. printf("Failed to open keyboard!\n");
  9. }
  10. // Create a buffer to fill with our name
  11. char buffer[256];
  12. printf("You should enter your name: ");
  13. // Get a string from the user, the TRUE represents
  14. // whether or not you want it to type the
  15. // name on the screen as you type it in.
  16. getString(buffer, 256, TRUE);
  17. printf("Hello, %s!", buffer);
  18. return 0;
  19. }

You should really join us on the IRC. Good discussions, plenty of support.

Please tell me of any problems or other feedback either on the Repository page or here!

Thanks,
Braden (Beta) McDorman

"When you do things right, people won't know you've done anything at all."