Ticket #7963: getkbid.cpp

File getkbid.cpp, 277 bytes (added by jscipione, 8 years ago)

Small test program to check your keyboard id. Compile with gcc -lbe -o getkbid getkbid.cpp and run from the command line.

Line 
1#include <stdio.h>
2
3#include <InterfaceDefs.h>
4
5int main(void)
6{
7 uint16 keyboard_id = 143;
8 status_t status;
9 status = get_keyboard_id(&keyboard_id);
10 if (status == B_OK) {
11 printf("Keyboard id is: %u\n", keyboard_id);
12 } else
13 printf("Error: %d\n", status);
14
15 return 0;
16}