Skip to content

Commit

Permalink
Editor: Doc Manager passes key evt to currentPane first
Browse files Browse the repository at this point in the history
This lets current pane to handle editor-specific Control combinations more reliably.
  • Loading branch information
ivan-mogilko committed Nov 2, 2024
1 parent 93dbdd6 commit 4121170
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Editor/AGS.Editor/GUI/TabbedDocumentManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,11 @@ private void RemoveDocument(ContentDocument pane, bool canCancel)

public bool ProcessKeyDown(Keys key)
{
if ((key == (Keys.Control | Keys.F4)) ||
if (_currentPane != null && _currentPane.Control.KeyPressed(key))
{
return true;
}
else if ((key == (Keys.Control | Keys.F4)) ||
(key == (Keys.Control | Keys.W)))
{
if (_currentPane != null)
Expand Down Expand Up @@ -355,16 +359,16 @@ public bool ProcessKeyDown(Keys key)
}
return true;
}
else if (_currentPane != null)
{
return _currentPane.Control.KeyPressed(key);
}
return false;
}

public bool ProcessKeyUp(Keys key)
{
if (key == Keys.ControlKey)
if (_currentPane != null && _currentPane.Control.KeyReleased(key))
{
return true;
}
else if (key == Keys.ControlKey)
{
if (_flipThroughPanesIndex < _panes.Count)
{
Expand All @@ -373,10 +377,6 @@ public bool ProcessKeyUp(Keys key)
}
_flipThroughPanesIndex = 0;
}
else if (_currentPane != null)
{
return _currentPane.Control.KeyReleased(key);
}
return false;
}

Expand Down

0 comments on commit 4121170

Please sign in to comment.