private void HandleMiddleMouseButton() { if (MouseHistory[0].MiddleButton == ButtonState.Pressed) { if (MouseHistory[1].MiddleButton == ButtonState.Pressed) { MouseCommands.Add(new MouseCommand(MouseKeys.MiddleButton, InputState.Held, MouseHistory[0].Position)); } else { MouseCommands.Add(new MouseCommand(MouseKeys.MiddleButton, InputState.Pressed, MouseHistory[0].Position)); } } else if (MouseHistory[1].MiddleButton == ButtonState.Pressed) { MouseCommands.Add(new MouseCommand(MouseKeys.MiddleButton, InputState.Released, MouseHistory[0].Position)); } }
private void HandleLeftMouseButton() { if (MouseHistory[0].LeftButton == ButtonState.Pressed) { if (MouseHistory[1].LeftButton == ButtonState.Pressed) //Adds a one frame latency. { MouseCommands.Add(new MouseCommand(MouseKeys.LeftButton, InputState.Held, MouseHistory[0].Position)); } else { MouseCommands.Add(new MouseCommand(MouseKeys.LeftButton, InputState.Pressed, MouseHistory[0].Position)); } } else if (MouseHistory[1].LeftButton == ButtonState.Pressed) { MouseCommands.Add(new MouseCommand(MouseKeys.LeftButton, InputState.Released, MouseHistory[0].Position)); } }