I'm using winapi SendInput with scancodes to simulate keyboard input to a game, and at the same time I want to measure the timing of the input being received, but unfortunately I've no access to that data from the game itself.
I know it uses listens to raw input, using the RegisterRawInputDevices, so I've my program take two measurements, timing right before calling sendinput and listing to the rawinput itself, the timing that my program received the input sent by RegisterRawInputDevices, by subtracting the two, I can have a rough estimation of the latency of the input stack.
Is my assumption correct, and the time at which I received the raw input, will probably be a better approximation to the time the game received it, that the time at which I called sendInput, and is there a better way of measuring that?
SendInput()posts its events into the same input queue that hardware devices post their events to. Thus, the Raw Input API can pick upSendInput()events.