Skip to content

Commit e6c0178

Browse files
committed
Make Enter key always work in object selection windows, regardless of the currently selected control
1 parent 7806dbf commit e6c0178

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/TSMapEditor/UI/Windows/SelectObjectWindow.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,20 @@ private void SelectObjectWindow_EnabledChanged(object sender, EventArgs e)
126126
if (!Enabled)
127127
{
128128
HideInfoPanel();
129+
Keyboard.OnKeyDown -= Keyboard_OnKeyDown;
130+
}
131+
else
132+
{
133+
Keyboard.OnKeyDown += Keyboard_OnKeyDown;
134+
}
135+
}
136+
137+
private void Keyboard_OnKeyDown(object sender, Rampastring.XNAUI.Input.KeyPressEventArgs e)
138+
{
139+
if (e.PressedKey == Microsoft.Xna.Framework.Input.Keys.Enter)
140+
{
141+
ConfirmSelection();
142+
e.Handled = true;
129143
}
130144
}
131145

0 commit comments

Comments
 (0)