How to find out a device name from its device identifier in OS X?

I am writing a program in OS X that receives click events from the mouse and touchpad. When the user clicks somewhere, the OS sends the device identifier, which is just an int, and the cursor position to my callback function. I want to know if a mouse click or touchpad event occurs. So how do you know the name of a device from its device identifier?

Thanks!

(I apologize for my poor English.)

+3
source share
2 answers

IOKit Registry.
: HID Explorer

, , , IOKit, grep ioreg:

ioreg |grep 'Track'
+2

-, IORegistryEntrySearchCFProperty() kIORegistryIterateRecursively(), , , . , .

IORegistry Explorer .

+1

Source: https://habr.com/ru/post/1722076/


All Articles