Fokus wird auf Map gelegt, wenn in Chatfenster ESC-Gedrückt wird
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,11 @@ namespace WorldOfPeacecraft
|
||||
Backend = backend;
|
||||
}
|
||||
|
||||
public void FocusMap ()
|
||||
{
|
||||
MapPanel.Focus();
|
||||
}
|
||||
|
||||
protected override void OnLoad (EventArgs e)
|
||||
{
|
||||
base.OnLoad (e);
|
||||
|
||||
Reference in New Issue
Block a user