void globalFocusChanged (juce::Component*)
           {
 #if ! JucePlugin_EditorRequiresKeyboardFocus
               if (hasKeyboardFocus (true))
                   passFocusToHostWindow (hostWindow);
 #endif
           }
Пример #2
0
//==============================================================================
void TopLevelWindow::focusOfChildComponentChanged (FocusChangeType)
{
    if (hasKeyboardFocus (true))
        TopLevelWindowManager::getInstance()->timerCallback();
    else
        TopLevelWindowManager::getInstance()->startTimer (10);
}
//==============================================================================
void VstPluginExternalEditor::mouseExit (const MouseEvent& e)
{
#if defined(LINUX)
    if (! handle) return;

    XEvent ev;
    zerostruct (ev);
    ev.xcrossing.display = display;
    ev.xcrossing.type = LeaveNotify;
    ev.xcrossing.window = handle;
    ev.xcrossing.root = RootWindow (display, DefaultScreen (display));
    ev.xcrossing.time = CurrentTime;
    ev.xcrossing.x = e.x;
    ev.xcrossing.y = e.y;
    ev.xcrossing.x_root = e.getScreenX ();
    ev.xcrossing.y_root = e.getScreenY ();
    ev.xcrossing.mode = NotifyNormal; // NotifyGrab, NotifyUngrab
    ev.xcrossing.detail = NotifyAncestor; // NotifyVirtual, NotifyInferior, NotifyNonlinear,NotifyNonlinearVirtual
    ev.xcrossing.focus = hasKeyboardFocus (true); // TODO - yes ?

    translateJuceToXCrossingModifiers (e, ev);

    sendEventToChild (& ev);
#endif
}
Пример #4
0
	iWidget::~iWidget()
	{
		if (hasKeyboardFocus())
		{
			_keyboardFocus = nullptr;
		}
    }
Пример #5
0
void HelmStandaloneEditor::handleMessage(const Message& message) {
#ifdef JUCE_MAC
  Thread::sleep(100);
  if(!hasKeyboardFocus(false)) {
    postMessage(new Message());
    grabKeyboardFocus();
  }
#endif
}
Пример #6
0
//==============================================================================
void Label::textEditorTextChanged (TextEditor& ed)
{
    if (editor != nullptr)
    {
        jassert (&ed == editor);

        if (! (hasKeyboardFocus (true) || isCurrentlyBlockedByAnotherModalComponent()))
        {
            if (lossOfFocusDiscardsChanges)
                textEditorEscapeKeyPressed (ed);
            else
                textEditorReturnKeyPressed (ed);
        }
    }
}