25 #ifndef JUCE_TEXTEDITORKEYMAPPER_H_INCLUDED 26 #define JUCE_TEXTEDITORKEYMAPPER_H_INCLUDED 35 template <
class CallbackClass>
48 int numCtrlAltCommandKeys = 0;
49 if (mods.
isCtrlDown()) ++numCtrlAltCommandKeys;
50 if (mods.
isAltDown()) ++numCtrlAltCommandKeys;
65 ++numCtrlAltCommandKeys;
68 if (numCtrlAltCommandKeys < 2)
74 : target.moveCaretToStartOfLine (isShiftDown);
76 : target.moveCaretToEndOfLine (isShiftDown);
79 if (numCtrlAltCommandKeys == 0)
90 return target.copyToClipboard();
94 return target.cutToClipboard();
98 return target.pasteFromClipboard();
101 if (numCtrlAltCommandKeys < 2)
108 return target.selectAll();
111 return target.undo();
115 return target.redo();
122 #endif // JUCE_TEXTEDITORKEYMAPPER_H_INCLUDED static const int pageUpKey
Definition: juce_KeyPress.h:197
static const int endKey
Definition: juce_KeyPress.h:200
bool isCtrlDown() const noexcept
Definition: juce_ModifierKeys.h:106
static const int deleteKey
Definition: juce_KeyPress.h:189
Definition: juce_KeyPress.h:37
Definition: juce_TextEditorKeyMapper.h:36
static const int insertKey
Definition: juce_KeyPress.h:191
static const int leftKey
Definition: juce_KeyPress.h:195
static const int downKey
Definition: juce_KeyPress.h:194
Definition: juce_ModifierKeys.h:38
bool isCommandDown() const noexcept
Definition: juce_ModifierKeys.h:66
static const int backspaceKey
Definition: juce_KeyPress.h:190
bool isAltDown() const noexcept
Definition: juce_ModifierKeys.h:109
Definition: juce_ModifierKeys.h:119
static const int homeKey
Definition: juce_KeyPress.h:199
static const int pageDownKey
Definition: juce_KeyPress.h:198
Definition: juce_ModifierKeys.h:122
bool isShiftDown() const noexcept
Definition: juce_ModifierKeys.h:97
static const int rightKey
Definition: juce_KeyPress.h:196
static const int upKey
Definition: juce_KeyPress.h:193
ModifierKeys getModifiers() const noexcept
Definition: juce_KeyPress.h:110
static bool invokeKeyFunction(CallbackClass &target, const KeyPress &key)
Definition: juce_TextEditorKeyMapper.h:41
bool isKeyCode(int keyCodeToCompare) const noexcept
Definition: juce_KeyPress.h:127
Definition: juce_ModifierKeys.h:145