From 9c97544fc58fbb03b066fd387e519e0ad0f57697 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 15 Jul 2011 04:03:48 +0000 Subject: [PATCH] Temporary hack to make the visual typesetting tool mode hotkeys work Originally committed to SVN as r5445. --- aegisub/src/video_display.cpp | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/aegisub/src/video_display.cpp b/aegisub/src/video_display.cpp index 7ae266a15..85ff3a49c 100644 --- a/aegisub/src/video_display.cpp +++ b/aegisub/src/video_display.cpp @@ -448,27 +448,20 @@ void VideoDisplay::OnMouseEvent(wxMouseEvent& event) { ShowCursor(activeMode != Video_Mode_Standard); } void VideoDisplay::OnKeyDown(wxKeyEvent &event) { - event.StopPropagation(); - if (hotkey::check("Video Display", event.GetKeyCode(), event.GetUnicodeKey(), event.GetModifiers())) - return; - -/* - int key = event.GetKeyCode(); -#ifdef __APPLE__ - Hotkeys.SetPressed(key, event.m_metaDown, event.m_altDown, event.m_shiftDown); -#else - Hotkeys.SetPressed(key, event.m_controlDown, event.m_altDown, event.m_shiftDown); -#endif - - if (Hotkeys.IsPressed(L"Visual Tool Default")) SetMode(Video_Mode_Standard); - else if (Hotkeys.IsPressed(L"Visual Tool Drag")) SetMode(Video_Mode_Drag); - else if (Hotkeys.IsPressed(L"Visual Tool Rotate Z")) SetMode(Video_Mode_Rotate_Z); - else if (Hotkeys.IsPressed(L"Visual Tool Rotate X/Y")) SetMode(Video_Mode_Rotate_XY); - else if (Hotkeys.IsPressed(L"Visual Tool Scale")) SetMode(Video_Mode_Scale); - else if (Hotkeys.IsPressed(L"Visual Tool Rectangular Clip")) SetMode(Video_Mode_Clip); - else if (Hotkeys.IsPressed(L"Visual Tool Vector Clip")) SetMode(Video_Mode_Vector_Clip); - event.Skip(); -*/ + /// @todo + int kc = event.GetKeyCode(); + if (kc == 'A') SetMode(Video_Mode_Standard); + else if (kc == 'S') SetMode(Video_Mode_Drag); + else if (kc == 'D') SetMode(Video_Mode_Rotate_Z); + else if (kc == 'F') SetMode(Video_Mode_Rotate_XY); + else if (kc == 'G') SetMode(Video_Mode_Scale); + else if (kc == 'H') SetMode(Video_Mode_Clip); + else if (kc == 'J') SetMode(Video_Mode_Vector_Clip); + else { + event.StopPropagation(); + if (hotkey::check("Video Display", event.GetKeyCode(), event.GetUnicodeKey(), event.GetModifiers())) + return; + } }