Fokus wird auf Map gelegt, wenn in Chatfenster ESC-Gedrückt wird

This commit is contained in:
2014-05-02 11:55:03 +02:00
parent d14eaa4822
commit 721f2c452e
2 changed files with 13 additions and 9 deletions

View File

@@ -29,14 +29,12 @@ namespace WorldOfPeacecraft
private void KeyDownEvent (object o, KeyEventArgs args)
{
if (args.KeyCode == Keys.Return) {
if (this.Text != "")
{
if (this.Text != "") {
string message = this.Text;
this.Text = "";
if (CurrentHistoryEntry == null) {
InputHistory.AddLast (message);
}
else {
} else {
CurrentHistoryEntry.Value = message;
CurrentHistoryEntry = null;
}
@@ -49,9 +47,8 @@ namespace WorldOfPeacecraft
if (InputHistory.Count > 0) {
if (CurrentHistoryEntry == null) {
CurrentHistoryEntry = InputHistory.Last;
if (this.Text != "")
{
InputHistory.AddLast(this.Text);
if (this.Text != "") {
InputHistory.AddLast (this.Text);
}
this.Text = CurrentHistoryEntry.Value;
args.Handled = true;
@@ -65,8 +62,7 @@ namespace WorldOfPeacecraft
}
}
} else if (args.KeyCode == Keys.Down) {
if (CurrentHistoryEntry != null)
{
if (CurrentHistoryEntry != null) {
CurrentHistoryEntry.Value = this.Text;
CurrentHistoryEntry = CurrentHistoryEntry.Next;
if (CurrentHistoryEntry == null) {
@@ -75,6 +71,9 @@ namespace WorldOfPeacecraft
this.Text = CurrentHistoryEntry.Value;
}
}
} else if (args.KeyCode == Keys.Escape) {
((Gui)this.Parent.Parent).FocusMap();
args.Handled = true;
}
}
}