static void InputHelper_KeyPressed(object sender, crossGFX.Input.KeyEventArgs e) { //Console.WriteLine("::Key Pressed: " + e.Code); switch (e.Code) { case crossGFX.Input.Key.Left: shipPosition.X -= 5; break; case crossGFX.Input.Key.Right: shipPosition.X += 5; break; case crossGFX.Input.Key.Up: shipPosition.Y -= 5; break; case crossGFX.Input.Key.Down: shipPosition.Y += 5; break; } }
private static Mouse.Button TranslateButtonCode(crossGFX.Input.MouseButton mouseButton) { return (Mouse.Button)mouseButton; }
void mouseButtonPressed(crossGFX.Input.MouseButton mouseButton, int x, int y) { if (MouseButtonPressed != null) { MouseButtonPressed(this, new Input.MouseButtonEventArgs(mouseButton, true, x, y)); } }
//void renderWindow_TextEntered(object sender, TextEventArgs e) { // if (TextEntered != null) { // Console.WriteLine(e.Unicode); // TextEntered(this, new TextEnteredEventArgs(e.Unicode)); // } //} void mouseButtonReleased(crossGFX.Input.MouseButton mouseButton, int x, int y) { if (MouseButtonReleased != null) { MouseButtonReleased(this, new Input.MouseButtonEventArgs(mouseButton, false, x, y)); } }
private static SdlDotNet.Input.MouseButton TranslateButtonCode(crossGFX.Input.MouseButton mouseButton) { switch (mouseButton) { case Input.MouseButton.Left: return SdlDotNet.Input.MouseButton.PrimaryButton; case Input.MouseButton.Right: return SdlDotNet.Input.MouseButton.SecondaryButton; case Input.MouseButton.Middle: return SdlDotNet.Input.MouseButton.MiddleButton; default: return SdlDotNet.Input.MouseButton.None; } }