| 2837 | }; |
| 2838 | |
| 2839 | static void HandleKeyScrolling() |
| 2840 | { |
| 2841 | /* |
| 2842 | * Check that any of the dirkeys is pressed and that the focused window |
| 2843 | * doesn't have an edit-box as focused widget. |
| 2844 | */ |
| 2845 | if (_dirkeys && !EditBoxInGlobalFocus()) { |
| 2846 | int factor = _shift_pressed ? 50 : 10; |
| 2847 | |
| 2848 | if (_game_mode != GM_MENU && _game_mode != GM_BOOTSTRAP) { |
| 2849 | /* Key scrolling stops following a vehicle. */ |
| 2850 | Window *main_window = GetMainWindow(); |
| 2851 | main_window->viewport->CancelFollow(*main_window); |
| 2852 | } |
| 2853 | |
| 2854 | ScrollMainViewport(scrollamt[_dirkeys][0] * factor, scrollamt[_dirkeys][1] * factor); |
| 2855 | } |
| 2856 | } |
| 2857 | |
| 2858 | static void MouseLoop(MouseClick click, int mousewheel) |
| 2859 | { |
no test coverage detected