Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item Context Menu - Change option selection to Single click instead of Double click #1486

Merged
merged 4 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions addons/ui/fnc_openItemContextMenu.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,17 @@ _list setVariable [QFUNC(activate), {
};
}];

_list ctrlAddEventHandler ["lbDblClick", {
params ["_list"];
_this call (_list getVariable QFUNC(activate));
_list ctrlAddEventHandler ["LBSelChanged", {
[{
params ["_list"];
_this call (_list getVariable QFUNC(activate));
}, _this] call CBA_fnc_execNextFrame;
}];

_list ctrlAddEventHandler ["KeyDown", {
params ["_list", "_key"];
if (_key in [DIK_RETURN, DIK_NUMPADENTER]) then {
[_list getVariable QFUNC(activate), [_list, lbCurSel _list]] call CBA_fnc_execNextFrame;

// Set focus on background to prevent the inventory menu from auto closing.
ctrlSetFocus (ctrlParent _list displayCtrl IDC_FG_GROUND_TAB);
};
params ["", "_key"];
// keyboard's Up/Down events intercepted to prevent LBSelChanged event
if !(_key in [DIK_UP, DIK_DOWN]) exitWith {};
true
}];

// ---
Expand Down