From 0d2ea240ab3aaaee35a8cb3a31b783fdf481a448 Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 23 Aug 2007 15:22:19 +0000 Subject: [PATCH] --- .../gui/components/controls/juce_ListBox.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/juce_appframework/gui/components/controls/juce_ListBox.cpp b/src/juce_appframework/gui/components/controls/juce_ListBox.cpp index d774c049e1..b3888abd05 100644 --- a/src/juce_appframework/gui/components/controls/juce_ListBox.cpp +++ b/src/juce_appframework/gui/components/controls/juce_ListBox.cpp @@ -314,6 +314,23 @@ public: g.fillAll (owner.findColour (ListBox::backgroundColourId)); } + bool keyPressed (const KeyPress& key) + { + if (key.isKeyCode (KeyPress::upKey) + || key.isKeyCode (KeyPress::downKey) + || key.isKeyCode (KeyPress::pageUpKey) + || key.isKeyCode (KeyPress::pageDownKey) + || key.isKeyCode (KeyPress::homeKey) + || key.isKeyCode (KeyPress::endKey)) + { + // we want to avoid these keypresses going to the viewport, and instead allow + // them to pass up to our listbox.. + return false; + } + + return Viewport::keyPressed (key); + } + //============================================================================== juce_UseDebuggingNewOperator