bool InputProcessor.Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e) { keyDownScripts[(int)e.Key].Call(); scriptable.addLoopFunc(whileKeyDownScripts[(int)e.Key]); return true; }
public bool Keyboard_KeyUp(object sender, KeyboardKeyEventArgs e) { if(focusedControl != null) { return focusedControl.Keyboard_KeyUp(sender, e); } else { return false; } }
public override bool Keyboard_KeyUp(object sender, KeyboardKeyEventArgs e) { return true; }
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; }
public override bool Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e) { return false; }
public abstract bool Keyboard_KeyDown(object sender, KeyboardKeyEventArgs e);