From c759733ce6a10de7ca6672482c4acfecea27c9bb Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 5 Sep 2007 16:38:28 +0000 Subject: [PATCH] --- docs/JUCE changelist.txt | 1 + .../gui/components/windows/juce_ComponentPeer.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/JUCE changelist.txt b/docs/JUCE changelist.txt index bab4a870c4..572be7b1f8 100644 --- a/docs/JUCE changelist.txt +++ b/docs/JUCE changelist.txt @@ -16,6 +16,7 @@ Changelist for version 1.45 - added a critical section option to ReferenceCountedArray - refactored and added features to the Socket class, replacing it with StreamableSocket (basically the same as the original class), and DatagramSocket. - refactored the OpenGLComponent, adding new classes OpenGLPixelFormat and OpenGLContext +- A component's KeyListeners are now called before its keyPressed method, so if you want to intercept keys and stop them getting sent to the component, you can add a keylistener and comsume the events. ============================================================================== Changelist for version 1.44 diff --git a/src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp b/src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp index 80e88323ad..bedc83bcd3 100644 --- a/src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp +++ b/src/juce_appframework/gui/components/windows/juce_ComponentPeer.cpp @@ -434,11 +434,6 @@ bool ComponentPeer::handleKeyPress (const int keyCode, { const ComponentDeletionWatcher deletionChecker (target); - keyWasUsed = target->keyPressed (keyInfo); - - if (keyWasUsed || deletionChecker.hasBeenDeleted()) - break; - if (target->keyListeners_ != 0) { for (int i = target->keyListeners_->size(); --i >= 0;) @@ -452,6 +447,11 @@ bool ComponentPeer::handleKeyPress (const int keyCode, } } + keyWasUsed = target->keyPressed (keyInfo); + + if (keyWasUsed || deletionChecker.hasBeenDeleted()) + break; + if (keyInfo.isKeyCode (KeyPress::tabKey) && Component::getCurrentlyFocusedComponent() != 0) { Component::getCurrentlyFocusedComponent()