Add missing check for modifier of Ctrl+F hotkey

The hotkey for the "Find empty slot" button was not correctly checking for a pressed modifier, so it was already being trigger by just the key F instead of the desired Ctrl+F.
This commit is contained in:
Robert Müller 2022-11-01 22:35:31 +01:00
parent 8e9b4ddcd2
commit 886ec990fe

View file

@ -1514,7 +1514,7 @@ int CEditor::PopupTele(CEditor *pEditor, CUIRect View, void *pContext)
// find empty number button
{
static int s_EmptySlotPid = 0;
if(pEditor->DoButton_Editor(&s_EmptySlotPid, "F", 0, &FindEmptySlot, 0, "[ctrl+f] Find empty slot") || pEditor->Input()->KeyPress(KEY_F))
if(pEditor->DoButton_Editor(&s_EmptySlotPid, "F", 0, &FindEmptySlot, 0, "[ctrl+f] Find empty slot") || (pEditor->Input()->ModifierIsPressed() && pEditor->Input()->KeyPress(KEY_F)))
{
int number = -1;
for(int i = 1; i <= 255; i++)
@ -1613,7 +1613,7 @@ int CEditor::PopupSwitch(CEditor *pEditor, CUIRect View, void *pContext)
// find empty number button
{
static int s_EmptySlotPid = 0;
if(pEditor->DoButton_Editor(&s_EmptySlotPid, "F", 0, &FindEmptySlot, 0, "[ctrl+f] Find empty slot") || pEditor->Input()->KeyPress(KEY_F))
if(pEditor->DoButton_Editor(&s_EmptySlotPid, "F", 0, &FindEmptySlot, 0, "[ctrl+f] Find empty slot") || (pEditor->Input()->ModifierIsPressed() && pEditor->Input()->KeyPress(KEY_F)))
{
int number = -1;
for(int i = 1; i <= 255; i++)