Difference between revisions of "User:Cboomf/libusbkbd"
Jump to navigation
Jump to search
(New page: Provides a simple way to add usb keybard support to any app. Currently in alpha testing stages. == Readme == == Documentation == === Functions === <source lang="c"> char* kbdhandle(in...) |
|||
Line 31: | Line 31: | ||
kbddeinit(kbdfd); | kbddeinit(kbdfd); | ||
</source> | </source> | ||
+ | |||
+ | Demo : [[Image:Kbd.rar]] |
Revision as of 09:48, 28 July 2008
Provides a simple way to add usb keybard support to any app.
Currently in alpha testing stages.
Readme
Documentation
Functions
char* kbdhandle(int fd, char message[15], bool output);
int kbdinit();
void kbddeinit(int kbdfd);
char* kbdscan(int kbdfd);
int kbdver();
kbdver(); = returns the lib version
kbdinit(); = inits the lib and returns the keyboard fd handle
kbdscan(); = similar to WPAD_Scan(); but returns the raw message from the kbd, must be passed what kbd returned
kbdhandle(); = returns the charachter or code of what was pressed, fd is what kbdinit returned, message is what kbdscan returns, output is whether you want the full breakdown of the message
kbddeinit(); = closes the library, must be done before exit(0); or similar, must be passed what kbdinit returned
Examples :
int kbdfd = kbdinit();
char receivedmessage[15] = kbdscan(kbdfd);
char* pressed = kbdhandle(kbdfd, receivedmessage, false);
printf("%s was pressed\n", pressed);
kbddeinit(kbdfd);
Demo : File:Kbd.rar