Skip to content

Commit

Permalink
Move hotkey config query out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
palana committed Oct 10, 2014
1 parent edf53af commit d789779
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ void OBSAPIInterface::HandleHotkeys()
{
List<DWORD> hitKeys;

bool allow_other_hotkey_modifiers = !!GlobalConfig->GetInt(TEXT("General"), TEXT("AllowOtherHotkeyModifiers"), true);
DWORD modifiers = 0;
if(GetAsyncKeyState(VK_MENU) & 0x8000)
modifiers |= HOTKEYF_ALT;
Expand Down Expand Up @@ -808,7 +809,7 @@ void OBSAPIInterface::HandleHotkeys()
else
{
bool bModifiersMatch = false;
if(GlobalConfig->GetInt(TEXT("General"), TEXT("AllowOtherHotkeyModifiers"), true))
if(allow_other_hotkey_modifiers)
bModifiersMatch = ((hotkeyModifiers & modifiers) == hotkeyModifiers); //allows other modifiers to be pressed
else
bModifiersMatch = (hotkeyModifiers == modifiers);
Expand Down

0 comments on commit d789779

Please sign in to comment.