Hi, I’d like to return a KeyPress by a func but compiler says:
No matching constructor for initialization of ‘juce::KeyPress’
Here’s the code:
KeyPress getRightScrollKeys() { return KeyPress(KeyPress::rightKey, ModifierKeys::altModifier); }
why? I follow the docs in source of KeyPress file:
/** Creates a KeyPress for a key and some modifiers.
e.g.
CTRL+C would be: KeyPress ('c', ModifierKeys::ctrlModifier)
SHIFT+Escape would be: KeyPress (KeyPress::escapeKey, ModifierKeys::shiftModifier)
@param keyCode a code that represents the key - this value must be
one of special constants listed in this class, or an
8-bit character code such as a letter (case is ignored),
digit or a simple key like "," or ".". Note that this
isn't the same as the textCharacter parameter, so for example
a keyCode of 'a' and a shift-key modifier should have a
textCharacter value of 'A'.
@param modifiers the modifiers to associate with the keystroke
@param textCharacter the character that would be printed if someone typed
this keypress into a text editor. This value may be
null if the keypress is a non-printing character
@see getKeyCode, isKeyCode, getModifiers
*/