Skip to content

Commit

Permalink
add enter-press functionality to a few text fields
Browse files Browse the repository at this point in the history
  • Loading branch information
warmCabin committed Jun 28, 2021
1 parent abf52c8 commit 90f4514
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/drivers/win/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1978,6 +1978,22 @@ void DebuggerBnClicked(HWND hwndDlg, uint16 btnId, HWND hwndBtn)
case ID_DEBUGGER_CODE_DUMPER:
DialogBox(fceu_hInstance, "CODEDUMPER", hwndDlg, DumperCallB);
break;
case IDOK:
// Make pressing Enter synonymous with the button you'd expect depending on the focus.
HWND focus;
switch (GetDlgCtrlID(focus = GetFocus()))
{
case IDC_DEBUGGER_VAL_PCSEEK:
DebuggerBnClicked(hwndDlg, IDC_DEBUGGER_SEEK_TO, NULL);
break;
case IDC_DEBUGGER_BOOKMARK:
DebuggerBnClicked(hwndDlg, IDC_DEBUGGER_BOOKMARK_ADD, NULL);
break;
case IDC_DEBUGGER_VAL_PC:
DebuggerBnClicked(hwndDlg, IDC_DEBUGGER_SEEK_PC, NULL);
break;
}
break;
}

// Buttons that only get handled when a game is loaded
Expand Down

0 comments on commit 90f4514

Please sign in to comment.