示例#1
0
        bool InputProcessor.Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
        {
            keyDownScripts[(int)e.Key].Call();

            scriptable.addLoopFunc(whileKeyDownScripts[(int)e.Key]);

            return true;
        }
示例#2
0
 public bool Keyboard_KeyUp(object sender, KeyboardKeyEventArgs e)
 {
     if(focusedControl != null)
     {
         return focusedControl.Keyboard_KeyUp(sender, e);
     } else
     {
         return false;
     }
 }
示例#3
0
 public override bool Keyboard_KeyUp(object sender, KeyboardKeyEventArgs e)
 {
     return true;
 }
示例#4
0
        public override bool Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
        {
            Key key = e.Key;

            if (key >= Key.A && key <= Key.Z)
            {
                string c = key.ToString();
                if (!(DualityApp.Keyboard.KeyPressed(Key.ShiftLeft) || (DualityApp.Keyboard.KeyPressed(Key.ShiftRight))))
                {
                    c = c.ToLower();
                }

                addText(c);
            }
            else if (key >= Key.Number0 && key <= Key.Number9)
            {
                int digit = key - Key.Number0;
                addText(digit.ToString());
            }
            else if (key >= Key.Keypad0 && key <= Key.Keypad9)
            {
                int digit = key - Key.Keypad0;
                addText(digit.ToString());
            }
            else if (key == Key.Left)
            {
                CaretOffset--;
            }
            else if (key == Key.Right)
            {
                CaretOffset++;
            }
            else
            {
                switch (key)
                {
                    case Key.BackSpace:
                        removeText(1);
                        break;
                    case Key.Space:
                        addText(" ");
                        break;
                    case Key.Comma:
                        addText(",");
                        break;
                    case Key.Enter:
                        addText("\n");
                        break;
                    case Key.Tab:
                        addText("\t");
                        break;
                    case Key.Period:
                    case Key.KeypadDecimal:
                        addText(".");
                        break;
                    default:
                        addText(key.ToString());
                        break;
                }
            }
            return true;
        }
示例#5
0
 public override bool Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e)
 {
     return false;
 }
示例#6
0
 public abstract bool Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e);