Skip to content
Open
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
15 changes: 12 additions & 3 deletions include/CLIBUtil/hotkeys.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ namespace clib_util::hotkeys
this->pattern = string::join(rawKeys, " + ");
}

bool Process(RE::InputEvent* const* a_event)
bool Process(RE::InputEvent* const* a_event, const bool a_ignoreMoveKeysOnKeyboard = false)
{
if (!isValid) {
return false;
Expand All @@ -244,11 +244,20 @@ namespace clib_util::hotkeys
break;
}

if (a_ignoreMoveKeysOnKeyboard)
{
if (key == 17 || key == 30 || key == 31 || key == 32)
{
continue;
}
}

if (button->IsPressed()) {
pressed.insert(key);
}
}


if (pressed == keys) {
if (!alreadyTriggered) {
alreadyTriggered = true;
Expand Down Expand Up @@ -295,7 +304,7 @@ namespace clib_util::hotkeys
this->pattern = string::join(rawKeys, " + ");
// Only non-empty KeyCombinations should be considered valid.
// However, we want to allow setting empty patterns to unbind given KeyCombination easily.
isValid = !keys.empty();
isValid = !keys.empty();
return true;
}

Expand All @@ -322,4 +331,4 @@ namespace clib_util::hotkeys
bool alreadyTriggered = false;
bool isValid = false;
};
}
}