Browse Source

Avoiding loops in win32 plugin key handling

tags/2021-05-28
jules 11 years ago
parent
commit
93bf34ad0a
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      modules/juce_audio_plugin_client/utility/juce_WindowsHooks.h

+ 6
- 0
modules/juce_audio_plugin_client/utility/juce_WindowsHooks.h View File

@@ -34,6 +34,7 @@ namespace
{
static HHOOK mouseWheelHook = 0, keyboardHook = 0;
static int numHookUsers = 0;
static bool keyboardHookReentrant = false;
struct WindowsHooks
{
@@ -89,6 +90,11 @@ namespace
static LRESULT CALLBACK keyboardHookCallback (int nCode, WPARAM wParam, LPARAM lParam)
{
if (keyboardHookReentrant)
return 1;
ScopedValueSetter<bool> setter (keyboardHookReentrant, true, false);
MSG& msg = *(MSG*) lParam;
if (nCode == HC_ACTION && offerKeyMessageToJUCEWindow (msg))


Loading…
Cancel
Save