# r726 demo plugin steal keys in Digital Performer

**URL:** <https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958>\
**Category:** Audio Plugins\
**Created:** [May 28, 2009, 10:25pm UTC](https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958 "2009-05-28T22:25:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Salvator](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@Salvator](https://forum.juce.com/u/Salvator)\
**Post date:** [May 28, 2009, 10:25pm UTC](https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958/1 "2009-05-28T22:25:25Z")

</div>

Hello,

I just tried to compile the Juce demo plugin r726 under OSX, and it appears to conflict with the keys in Digital Performer.

At first once instantiated/inserted the keys are passing thru to DP (i.e. spacebar & the like for play/stop/rewind …)  
But if you close the JuceDemoPlugin, then reopen it’s GUI, now the keys are not passing anymore to the host but generate osx alert sound.

The problem doesn’t happen with tag 1.46.

Anyone else ?

Salvator

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 29, 2009, 9:19am UTC](https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958/2 "2009-05-29T09:19:40Z")

</div>

Presumably it’d also happen if you just click in the Juce UI to give that window focus.

Bit of a tricky one to work out, as I’ve not got anything I can test it with, but how about this hack in juce\_AU\_Wrapper.mm, line 1204:

[code] addSubWindow();

```
        NSWindow* pluginWindow = [((NSView*) getWindowHandle()) window];
        [pluginWindow setNextResponder: hostWindow];

```

[/code]

---

<div class="post-metadata">

**Author:** ![Salvator](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@Salvator](https://forum.juce.com/u/Salvator)\
**Post date:** [May 29, 2009, 3:19pm UTC](https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958/3 "2009-05-29T15:19:03Z")

</div>

Hello Jules,

many thanks for the suggestion. I tried to copy/paste the mentionned code in juce\_AU\_Wrapper.mm r728

Unfortunately, i got 3 errors when compiling :  
/Downloads/trunk/extras/audio plugins/demo/build/mac/…/…/…/wrapper/AU/juce\_AU\_Wrapper.mm:1024: error: ‘addSubWindow’ was not declared in this scope

/Downloads/trunk/extras/audio plugins/demo/build/mac/…/…/…/wrapper/AU/juce\_AU\_Wrapper.mm:1026: error: ‘getWindowHandle’ was not declared in this scope

/Downloads/trunk/extras/audio plugins/demo/build/mac/…/…/…/wrapper/AU/juce\_AU\_Wrapper.mm:1027: error: ‘hostWindow’ was not declared in this scope

Thanks,

Salvator

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 29, 2009, 3:35pm UTC](https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958/4 "2009-05-29T15:35:45Z")

</div>

Well, you’d need my latest check-in. The code I added today has this change in it.

---

<div class="post-metadata">

**Author:** ![Salvator](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@Salvator](https://forum.juce.com/u/Salvator)\
**Post date:** [May 29, 2009, 8:30pm UTC](https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958/5 "2009-05-29T20:30:57Z")

</div>

Hello,

I just downloaded r728, compiled, and the issue persist in Digital performer 6.02.

note : it’s only in Digital performer, not in other AU host like i.e. Logic 8

Salvator

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 30, 2009, 8:58am UTC](https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958/6 "2009-05-30T08:58:51Z")

</div>

I’m a bit stuck for ideas then.

But you know that if your plugin doesn’t need keystrokes, you can set the config flag to disable it, and that’ll probably do the trick.

---

<div class="post-metadata">

**Author:** ![Salvator](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@Salvator](https://forum.juce.com/u/Salvator)\
**Post date:** [May 30, 2009, 11:40am UTC](https://forum.juce.com/t/r726-demo-plugin-steal-keys-in-digital-performer/3958/7 "2009-05-30T11:40:56Z")

</div>

Hello,

Thanks for your response. I’m a newscomer with JUCE so are you talking about “#define JucePlugin\_EditorRequiresKeyboardFocus 0” from JucePluginCharacteristics.h ?

If so, I’ve tried that already, but without sucess… I also tried to make a blank GUI with no control that could get key focus, and with almost no function.

But it’s just that as soon as the JuceDemo plugin is the frontmost window, every key (excluding apple dedicated volume, light, expose keys) are catched and do not pass thru to the host.

As it work fine with 1.46, I guess a solution exist somewhere …  
Am I condamned to stick with 1.46 eternally ? :lol:

Salvator
