From 0eed4799afcf1b0e877f9c2b6691a7d6c4aae579 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 8 Dec 2015 21:31:03 -0600 Subject: [PATCH] MicroDagr - Prevent Home Key being blocked Fix #2974 --- addons/microdagr/functions/fnc_updateDisplay.sqf | 6 ++++++ addons/microdagr/gui_controls.hpp | 2 +- addons/microdagr/script_component.hpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/microdagr/functions/fnc_updateDisplay.sqf b/addons/microdagr/functions/fnc_updateDisplay.sqf index 826ea55e6c..4b609085a8 100644 --- a/addons/microdagr/functions/fnc_updateDisplay.sqf +++ b/addons/microdagr/functions/fnc_updateDisplay.sqf @@ -171,6 +171,9 @@ case (APP_MODE_WAYPOINTS): { _currentIndex = (_currentIndex max 0) min (count _waypoints); _wpListBox lbSetCurSel _currentIndex; + + //Reset focus to a dummy ctrl (top button), otherwise HOME/POS1 key goes to top of listBox and has keybind blocked + ctrlSetFocus (_display displayCtrl IDC_TOPMENUBUTTON); }; case (APP_MODE_SETUP): { @@ -190,5 +193,8 @@ case (APP_MODE_SETUP): { } else { _settingListBox lbSetTextRight [1, (localize LSTRING(settingOff))]; }; + + //Reset focus to a dummy ctrl (top button), otherwise HOME/POS1 key goes to top of listBox and has keybind blocked + ctrlSetFocus (_display displayCtrl IDC_TOPMENUBUTTON); }; }; diff --git a/addons/microdagr/gui_controls.hpp b/addons/microdagr/gui_controls.hpp index 270a3325bd..a8fbb8f83f 100644 --- a/addons/microdagr/gui_controls.hpp +++ b/addons/microdagr/gui_controls.hpp @@ -140,7 +140,7 @@ class controlsBackground { class controls { class TopMenuClick: GVAR(RscActiveTextPicture) { - idc = -1; + idc = IDC_TOPMENUBUTTON; text = "#(argb,8,8,3)color(0,0,0,0)"; x = X_PART(0); y = Y_PART(0); diff --git a/addons/microdagr/script_component.hpp b/addons/microdagr/script_component.hpp index 72c5c125bc..0710649aaa 100644 --- a/addons/microdagr/script_component.hpp +++ b/addons/microdagr/script_component.hpp @@ -54,6 +54,7 @@ #define IDC_MODEDISPLAY_TARGETRANGENUM 144023 #define IDC_MODEDISPLAY_TARGETELEVATIONNUM 144024 #define IDC_MODEDISPLAY_TARGETNAME 144025 +#define IDC_TOPMENUBUTTON 144030 #define IDC_MODECOMPASS 144100 #define IDC_MODECOMPASS_HEADING 144110