I'm having trouble to make a programming that just simply detect mouse input programm in C programming. I tried to search some source codes, but everyone is using C++. Also even they use C language, they use <dos.h> and <graphics.h> which I cannot use. Also they are using Union REGS in and out, but I cant use thoese header file, so that I cant use them. Is there any other way I can make a programm that detect mouse input?? such as, if I just plug the mouse, then programm will just print mouse is detected, or mouse is connected well. Im using visual studio code. Thank you
#include <conio.h>
#include <direct.h>
#include <dos.h> // when I use this, complier said use direct.h
#include <graphics.h> // I've tried to add graphics.h files from winbGlm and paste it to Mingw lib but still not working.
#include <stdio.h>
union REGS in, out;
// Function to implement the functionality
// of detecting Mouse
void detectMouse()
{
in.x.ax = 0;
// Invoke interrupt (in86 method
// description mentioned above)
int86(0X33, &in, &out);
if (out.x.ax == 0)
printf("\nMouse Failed To Initialize");
else
printf("\nMouse was Successfully Initialized");
}