mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
changes to the keyPressed and keyStateChanged methods, so that they return a bool
This commit is contained in:
parent
727215e270
commit
03f66fe310
36 changed files with 320 additions and 229 deletions
|
|
@ -299,8 +299,8 @@ void JucerDocument::getOptionalMethods (StringArray& baseClasses,
|
|||
addMethod ("Component", "void", "mouseDoubleClick (const MouseEvent& e)", "", baseClasses, returnValues, methods, initialContents);
|
||||
addMethod ("Component", "void", "mouseWheelMove (const MouseEvent& e, float wheelIncrement)", "", baseClasses, returnValues, methods, initialContents);
|
||||
|
||||
addMethod ("Component", "void", "keyPressed (const KeyPress& key)", "", baseClasses, returnValues, methods, initialContents);
|
||||
addMethod ("Component", "void", "keyStateChanged()", "", baseClasses, returnValues, methods, initialContents);
|
||||
addMethod ("Component", "bool", "keyPressed (const KeyPress& key)", "return false; // Return true if your handler uses this key event, or false to allow it to be passed-on.", baseClasses, returnValues, methods, initialContents);
|
||||
addMethod ("Component", "bool", "keyStateChanged()", "return false; // Return true if your handler uses this key event, or false to allow it to be passed-on.", baseClasses, returnValues, methods, initialContents);
|
||||
addMethod ("Component", "void", "modifierKeysChanged (const ModifierKeys& modifiers)", "", baseClasses, returnValues, methods, initialContents);
|
||||
|
||||
addMethod ("Component", "void", "focusGained (FocusChangeType cause)", "", baseClasses, returnValues, methods, initialContents);
|
||||
|
|
|
|||
|
|
@ -325,7 +325,7 @@ static void moveOrStretch (ComponentLayout& layout, int x, int y, bool snap, boo
|
|||
layout.moveSelectedComps (x, y, snap);
|
||||
}
|
||||
|
||||
void ComponentLayoutEditor::keyPressed (const KeyPress& key)
|
||||
bool ComponentLayoutEditor::keyPressed (const KeyPress& key)
|
||||
{
|
||||
const bool snap = key.getModifiers().isAltDown();
|
||||
const bool stretch = key.getModifiers().isShiftDown();
|
||||
|
|
@ -351,8 +351,10 @@ void ComponentLayoutEditor::keyPressed (const KeyPress& key)
|
|||
}
|
||||
else
|
||||
{
|
||||
Component::keyPressed (key);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ComponentLayoutEditor::filesDropped (const StringArray& filenames, int x, int y)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public:
|
|||
void mouseDown (const MouseEvent& e);
|
||||
void mouseDrag (const MouseEvent& e);
|
||||
void mouseUp (const MouseEvent& e);
|
||||
void keyPressed (const KeyPress& key);
|
||||
bool keyPressed (const KeyPress& key);
|
||||
bool filesDropped (const StringArray& filenames, int x, int y);
|
||||
|
||||
ComponentLayout& getLayout() const throw() { return layout; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue