Skip to content

Commit

Permalink
hotkeys-4149
Browse files Browse the repository at this point in the history
  • Loading branch information
leamas committed Sep 25, 2024
1 parent b33905d commit 2b0017c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
34 changes: 14 additions & 20 deletions gui/src/chcanv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ EVT_TIMER(CURTRACK_TIMER, ChartCanvas::OnCursorTrackTimerEvent)
EVT_TIMER(ROT_TIMER, ChartCanvas::RotateTimerEvent)
EVT_TIMER(ROPOPUP_TIMER, ChartCanvas::OnRolloverPopupTimerEvent)
EVT_TIMER(ROUTEFINISH_TIMER, ChartCanvas::OnRouteFinishTimerEvent)
EVT_CHAR(ChartCanvas::OnKeyDown)
EVT_KEY_DOWN(ChartCanvas::OnKeyDown)
EVT_KEY_UP(ChartCanvas::OnKeyUp)
EVT_CHAR(ChartCanvas::OnKeyChar)
EVT_MOUSE_CAPTURE_LOST(ChartCanvas::LostMouseCapture)
Expand Down Expand Up @@ -2591,7 +2591,19 @@ void ChartCanvas::OnKeyChar(wxKeyEvent &event) {
// anything else

int key_char = event.GetKeyCode();

switch (key_char) {
case '?':
HotkeysDlg(wxWindow::FindWindowByName("MainWindow")).ShowModal();
break;
case '+':
ZoomCanvas(g_plus_minus_zoom_factor, false);
break;
case '-':
ZoomCanvas(1.0 / g_plus_minus_zoom_factor, false);
break;
default:
break;
}
if (g_benable_rotate) {
switch (key_char) {
case ']':
Expand Down Expand Up @@ -2856,18 +2868,6 @@ void ChartCanvas::OnKeyDown(wxKeyEvent &event) {
// Handle both QWERTY and AZERTY keyboard separately for a few control
// codes
if (!g_b_assume_azerty) {
switch (key_char) {
case '+':
case '=':
ZoomCanvas(g_plus_minus_zoom_factor, false);
break;

case '-':
case '_':
ZoomCanvas(1.0 / g_plus_minus_zoom_factor, false);
break;
}

#ifdef __WXMAC__
if (g_benable_rotate) {
switch (key_char) {
Expand Down Expand Up @@ -3037,12 +3037,6 @@ void ChartCanvas::OnKeyDown(wxKeyEvent &event) {

break;

case '?': {
auto parent = wxWindow::FindWindowByName("MainWindow");
HotkeysDlg dlg(parent);
dlg.ShowModal();
} break;

case 1: // Ctrl A
TogglebFollow();

Expand Down
2 changes: 1 addition & 1 deletion gui/src/hotkeys_dlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class GridSizer : public wxGridSizer {
{_("Toggle full screen"), "F11",
"", ""},
{"", "", "", ""},
{_("Start measure mode"), "F4",
{_("Start measure mode"), "M, F4",
_("Stop measure mode"), "Esc"},
{_("Drop mark"), _("Ctrl O, space bar"),
"", ""}}};
Expand Down

0 comments on commit 2b0017c

Please sign in to comment.