private void CanvasControl_PointerReleased(object sender, PointerRoutedEventArgs e) { var p = e.GetCurrentPoint((UIElement)sender); var mgi = new MouseGenericInput((float)p.Position.X, (float)p.Position.Y); mgi.Name = "mouse_up"; mgi.MouseInputType = MouseGenericInput.MouseGenericInputType.MouseReleased; mgi.IsLeftButtonPress = p.Properties.IsLeftButtonPressed; mgi.IsMiddleButtonPress = p.Properties.IsMiddleButtonPressed; mgi.IsRightButtonPress = p.Properties.IsRightButtonPressed; mgi.MouseDown = mgi.IsRightButtonPress | mgi.IsMiddleButtonPress | mgi.IsLeftButtonPress; InputManager.AddInputItem(mgi); }
private void CanvasControl_PointerPressed(object sender, PointerRoutedEventArgs e) { e.Handled = true; Windows.UI.Input.PointerPoint p = e.GetCurrentPoint((UIElement)sender); MouseGenericInput mgi = new MouseGenericInput((float)p.Position.X, (float)p.Position.Y); mgi.Name = "mouse_down"; mgi.MouseInputType = MouseGenericInputType.MousePressed; mgi.IsLeftButtonPress = p.Properties.IsLeftButtonPressed; mgi.IsMiddleButtonPress = p.Properties.IsMiddleButtonPressed; mgi.IsRightButtonPress = p.Properties.IsRightButtonPressed; mgi.MouseDown = mgi.IsRightButtonPress | mgi.IsMiddleButtonPress | mgi.IsLeftButtonPress; InputManager.AddInputItem(mgi); }