public override bool HandleInput() { if (GeneralManager.CheckKeyEdge(Keys.Enter) && IsActive || Helper.CheckLMBClick(Position)) { if (Action != null) { Action(); } return(true); } return(false); }
public override bool HandleInput() { if (Enabled) { foreach (Keys k in Enum.GetValues(typeof(Keys))) { if (GeneralManager.CheckKeyEdge(k)) { if (k == Keys.Space) { Text += " "; } else if (k == Keys.Back && Text.Length > 0) { Text = Text.Remove(Text.Length - 1); } else if (k >= Keys.A && k <= Keys.Z) { Text += k.ToString(); } else if (k >= Keys.D0 && k <= Keys.D9) { Text += k.ToString().ToCharArray(1, 1)[0].ToString(); } switch (k) { case Keys.OemPeriod: Text += "."; break; case Keys.OemComma: Text += ","; break; case Keys.OemMinus: Text += "-"; break; } return(true); } } } Measure(); return(false); }