Beispiel #1
0
    protected void OnKeyReleaseEvent(object o, KeyReleaseEventArgs args)
    {
        Kurve.Interface.Key key;

        Console.WriteLine(args.Event.Key);

        switch (args.Event.Key)
        {
        case Gdk.Key.Control_L: key = Kurve.Interface.Key.Control; break;

        case Gdk.Key.Shift_L: key = Kurve.Interface.Key.Shift; break;

        case Gdk.Key.Alt_L: key = Kurve.Interface.Key.Alt; break;

        case Gdk.Key.Meta_L: key = Kurve.Interface.Key.Alt; break;

        case Gdk.Key.Super_L: key = Kurve.Interface.Key.Windows; break;

        case Gdk.Key.r: key = Kurve.Interface.Key.R; break;

        case Gdk.Key.n: key = Kurve.Interface.Key.N; break;

        case Gdk.Key.l: key = Kurve.Interface.Key.L; break;

        case Gdk.Key.s: key = Kurve.Interface.Key.S; break;

        case Gdk.Key.e: key = Kurve.Interface.Key.E; break;

        case Gdk.Key.p: key = Kurve.Interface.Key.P; break;

        case Gdk.Key.d: key = Kurve.Interface.Key.D; break;

        case Gdk.Key.c: key = Kurve.Interface.Key.C; break;

        case Gdk.Key.Key_1: key = Kurve.Interface.Key.One; break;

        case Gdk.Key.Key_2: key = Kurve.Interface.Key.Two; break;

        // workaround for neo keyboard layout bug
        case Gdk.Key.Caps_Lock: key = Kurve.Interface.Key.Shift; break;

        default: return;
        }

        rootComponent.KeyUp(key);
    }