/
detect_mice.c
36 lines (29 loc) · 790 Bytes
1
/*
2
* A test file for ManyMouse that lists all seen mice.
3
*
4
* Please see the file LICENSE.txt in the source's root directory.
5
6
7
8
9
10
11
12
*
* This file written by Ryan C. Gordon.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
13
#include "manymouse.h"
14
15
16
int main(int argc, char **argv)
{
17
18
19
20
21
const int available_mice = ManyMouse_Init();
if (available_mice < 0)
printf("ManyMouse failed to initialize!\n");
else if (available_mice == 0)
22
23
24
25
printf("No mice detected!\n");
else
{
int i;
26
printf("ManyMouse driver: %s\n", ManyMouse_DriverName());
27
for (i = 0; i < available_mice; i++)
28
printf("#%d: %s\n", i, ManyMouse_DeviceName(i));
29
}
30
31
ManyMouse_Quit();
32
33
return 0;
} /* main */
34
35
/* end of detect_mice.c ... */