Skip to content

Commit

Permalink
Tweak SadConsole UI
Browse files Browse the repository at this point in the history
  • Loading branch information
highbyte committed Oct 3, 2024
1 parent 7b6f9ef commit c0d11e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ private void SetControlStates()
public async Task ToggleBasicAIAssistant()
{
var c64aiBasicAssistantCheckbox = Controls["c64aiBasicAssistantCheckbox"] as CheckBox;
await SetBasicAIAssistant(!c64aiBasicAssistantCheckbox.IsSelected);
c64aiBasicAssistantCheckbox.IsSelected = !c64aiBasicAssistantCheckbox.IsSelected;
}

private async Task SetBasicAIAssistant(bool enabled)
Expand Down
12 changes: 10 additions & 2 deletions src/apps/Highbyte.DotNet6502.App.SadConsole/SadConsoleHostApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ public void DisableMonitor()
_monitorStatusConsole.Disable();
OnMonitorStateChange(monitorEnabled: false);
}

public void EnableMonitor(ExecEvaluatorTriggerResult? execEvaluatorTriggerResult = null)
{
_monitorConsole.Enable(execEvaluatorTriggerResult);
Expand Down Expand Up @@ -589,17 +590,24 @@ private async Task HandleUIKeyboardInput()
// ToggleLogs();

if (keyboard.IsKeyPressed(Keys.F11))
{
keyboard.Clear();
ToggleInfo();
}

if (keyboard.IsKeyPressed(Keys.F12) && (EmulatorState == EmulatorState.Running || EmulatorState == EmulatorState.Paused))
if (keyboard.IsKeyReleased(Keys.F12) && (EmulatorState == EmulatorState.Running || EmulatorState == EmulatorState.Paused))
{
keyboard.Clear();
ToggleMonitor();
}

if (keyboard.IsKeyPressed(Keys.F9) && EmulatorState == EmulatorState.Running)
if (keyboard.IsKeyReleased(Keys.F9) && EmulatorState == EmulatorState.Running)
{
keyboard.Clear();
if (_systemMenuConsole is C64MenuConsole c64MenuConsole)
{
await c64MenuConsole.ToggleBasicAIAssistant();
}
}
}
}

0 comments on commit c0d11e6

Please sign in to comment.