Find property for Touch-/ Trackpad by RawInputDeviceInfo to distinguish independent of the model/ manufacturer in registry

youki 891 Reputation points
2021-03-14T13:12:24.02+00:00

Hello,
I want to recognize, if the input is coming from the touch-/ trackpad independent of the Laptop model/ manufacturer.
Is it possible?

I'm getting the devicename by RawInputDeviceInfo and i see that there is the possibility to compare it with the registry entries but i can't see any property that tells me that it's the trackpad.

Registry path:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID...

Regards

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,070 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. youki 891 Reputation points
    2021-03-14T17:15:12.747+00:00
    0 comments No comments

  2. Strive Sun-MSFT 421 Reputation points
    2021-03-15T09:51:25.027+00:00

    Hello, @youki

    If you want to know whether the input comes from the touchpad, you can use GetCurrentInputMessageSource to retrieve the source of the input message.

    The INPUT_MESSAGE_SOURCE structure that holds the device type and the ID of the input message source.

    typedef enum tagINPUT_MESSAGE_DEVICE_TYPE {  
      IMDT_UNAVAILABLE,  
      IMDT_KEYBOARD,  
      IMDT_MOUSE,  
      IMDT_TOUCH,  
      IMDT_PEN,  
      IMDT_TOUCHPAD  
    } INPUT_MESSAGE_DEVICE_TYPE;  
    

    Note: [Windows 8 desktop apps only

    ----------

    Thank you!

    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.