From d2db4637c2681cb4d57922b85571f0c168b2686f Mon Sep 17 00:00:00 2001 From: MaxAkaAltmer Date: Sat, 21 Dec 2024 14:31:40 +0300 Subject: [PATCH] Count of devices. --- manymouse.c | 9 +++++++++ manymouse.h | 1 + 2 files changed, 10 insertions(+) diff --git a/manymouse.c b/manymouse.c index 7f88582..9149580 100644 --- a/manymouse.c +++ b/manymouse.c @@ -40,6 +40,7 @@ static const ManyMouseDriver **mice_drivers[] = static const ManyMouseDriver *driver = NULL; +static int many_mouse_counter=0; int ManyMouse_Init(void) { @@ -68,10 +69,18 @@ int ManyMouse_Init(void) } /* if */ } /* for */ + if(retval>0)many_mouse_counter=retval; + else many_mouse_counter=0; + return retval; } /* ManyMouse_Init */ +int ManyMouse_DeviceNumber(void) +{ + return many_mouse_counter; +} + void ManyMouse_Quit(void) { if (driver != NULL) diff --git a/manymouse.h b/manymouse.h index 870fa21..b1da917 100644 --- a/manymouse.h +++ b/manymouse.h @@ -48,6 +48,7 @@ typedef struct int ManyMouse_Init(void); +int ManyMouse_DeviceNumber(void); const char *ManyMouse_DriverName(void); void ManyMouse_Quit(void); const char *ManyMouse_DeviceName(unsigned int index);