I am coding in C++ targeting Windows WRL for UWP, and I need to process mouse input, at times consisting of left/right buttons being pressed simultaneously.
My code only receives an event for the first mouse button pressed and the last mouse button released. So, if I press the right button followed by the left button, PointerPressed is not fired for the left button. Similarly, if I release the right button and then release the left button, PointerReleased is not fired for the right button. I subscribed to the events as follows:
void App::SetWindow(CoreWindow^ window)
{
window->PointerPressed += ref new TypedEventHandler<CoreWindow ^, PointerEventArgs ^>(this, &App::OnPointerPressed);
window->PointerReleased += ref new TypedEventHandler<CoreWindow ^, PointerEventArgs ^>(this, &App::OnPointerReleased);
}
void App::OnPointerPressed(CoreWindow ^sender, PointerEventArgs ^args)
{
}
void App::OnPointerReleased(CoreWindow ^sender, PointerEventArgs ^args)
{
}
Please let me know if my code needs to reset something in between button presses/releases, or if I should subscribe to some other events.
Thanks