Browse Source

Altered the method by which plugin UIs re-post carbon keyboard events.

tags/2021-05-28
jules 12 years ago
parent
commit
5818b89b04
5 changed files with 16 additions and 3 deletions
  1. +1
    -1
      modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm
  2. +1
    -1
      modules/juce_audio_plugin_client/RTAS/juce_RTAS_MacUtilities.mm
  3. +1
    -1
      modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm
  4. +5
    -0
      modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h
  5. +8
    -0
      modules/juce_events/native/juce_mac_MessageManager.mm

+ 1
- 1
modules/juce_audio_plugin_client/AU/juce_AU_Wrapper.mm View File

@@ -1479,7 +1479,7 @@ private:
lastEventTime = eventTime;
[[hostWindow parentWindow] makeKeyWindow];
[NSApp postEvent: [NSApp currentEvent] atStart: YES];
repostCurrentNSEvent();
}
}


+ 1
- 1
modules/juce_audio_plugin_client/RTAS/juce_RTAS_MacUtilities.mm View File

@@ -162,7 +162,7 @@ void forwardCurrentKeyEventToHostWindow()
if (! isJuceWindow (w))
{
ActivateWindow (w, true);
[NSApp postEvent: [NSApp currentEvent] atStart: YES];
repostCurrentNSEvent();
}
}


+ 1
- 1
modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.mm View File

@@ -254,7 +254,7 @@ bool forwardCurrentKeyEventToHost (Component* comp)
#else
NSWindow* win = [(NSView*) comp->getWindowHandle() window];
[[win parentWindow] makeKeyWindow];
[NSApp postEvent: [NSApp currentEvent] atStart: YES];
repostCurrentNSEvent();
return true;
#endif
}


+ 5
- 0
modules/juce_audio_plugin_client/utility/juce_IncludeModuleHeaders.h View File

@@ -29,6 +29,11 @@ using namespace juce;
#if JUCE_MAC && ! DOXYGEN
#define Point juce::Point
#define Component juce::Component
namespace juce
{
void repostCurrentNSEvent();
}
#endif
extern AudioProcessor* JUCE_CALLTYPE createPluginFilterOfType (AudioProcessor::WrapperType);

+ 8
- 0
modules/juce_events/native/juce_mac_MessageManager.mm View File

@@ -328,3 +328,11 @@ void MessageManager::broadcastMessage (const String& message)
object: nil
userInfo: info];
}
// Special function used by some plugin classes to re-post carbon events
void repostCurrentNSEvent();
void repostCurrentNSEvent()
{
NSEvent* e = [NSApp currentEvent];
[[NSOperationQueue mainQueue] addOperationWithBlock: ^{ [NSApp postEvent: e atStart: YES]; }];
}

Loading…
Cancel
Save