Click to See Complete Forum and Search --> : How to get information about keyboard and mouse


motivatedlad
April 20th, 2005, 02:00 PM
How can we get the information about the presence or status of mouse and keyboard in a computer? e.g mouse of " ABC" company is working

motivatedlad
April 21st, 2005, 04:17 PM
Pals plz help me out and also provide examples
thanks

Bond
April 21st, 2005, 04:41 PM
Use GetSystemMetrics().

If it returns zero when used with SM_CMOUSEBUTTONS or SM_MOUSEPRESENT, then no mouse is present.

Not sure about detecting a keyboard.

RoyK
April 21st, 2005, 11:29 PM
I would try GetKeyboardType API. If it returns an unknown type, probably don't have a key board. I seem to recall that most computers don't boot with no keyboard but that may be bios specific.


see http://www.mentalis.org/apilist/GetKeyboardType.shtml for an example.