mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-21 01:24:21 +00:00
Altered the method by which plugin UIs re-post carbon keyboard events.
This commit is contained in:
parent
8c6caf8853
commit
5818b89b04
5 changed files with 16 additions and 3 deletions
|
|
@ -1479,7 +1479,7 @@ private:
|
|||
lastEventTime = eventTime;
|
||||
|
||||
[[hostWindow parentWindow] makeKeyWindow];
|
||||
[NSApp postEvent: [NSApp currentEvent] atStart: YES];
|
||||
repostCurrentNSEvent();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ void forwardCurrentKeyEventToHostWindow()
|
|||
if (! isJuceWindow (w))
|
||||
{
|
||||
ActivateWindow (w, true);
|
||||
[NSApp postEvent: [NSApp currentEvent] atStart: YES];
|
||||
repostCurrentNSEvent();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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…
Add table
Add a link
Reference in a new issue