Exemple #1
0
 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;
     }
 }
Exemple #2
0
 private static Mouse.Button TranslateButtonCode(crossGFX.Input.MouseButton mouseButton)
 {
     return (Mouse.Button)mouseButton;
 }
Exemple #3
0
 void mouseButtonPressed(crossGFX.Input.MouseButton mouseButton, int x, int y)
 {
     if (MouseButtonPressed != null) {
         MouseButtonPressed(this, new Input.MouseButtonEventArgs(mouseButton, true, x, y));
     }
 }
Exemple #4
0
 //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));
     }
 }
Exemple #5
0
 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;
     }
 }