Well, I've found I need to use Raw Input which is in the User32 dll.
Unfortunately, all the samples are in C or C++. It uses structures like
internal struct RAWINPUTDEVICE
public ushort usUsagePage;
public ushort usUsage;
public int dwFlags;
public IntPtr hwndTarget;
and API calls like
extern static bool RegisterRawInputDevices(RAWINPUTDEVICE pRawInputDevice, uint uiNumDevices, uint cbSize);
In VB6 I'd have got a reference via
Declare function RegisterRawInputDevices lib "USER32" (pRawInpoutDevice as ptr, numDevices as Integer, size as Integer) as boolean
but is there a better way in VB
.net and how do I best create the structure and its pointer?