LMMS
Loading...
Searching...
No Matches
juce_ModifierKeys.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29//==============================================================================
41{
42public:
43 //==============================================================================
45 ModifierKeys() = default;
46
53 ModifierKeys (int flags) noexcept;
54
56 ModifierKeys (const ModifierKeys&) = default;
57
59 ModifierKeys& operator= (const ModifierKeys&) = default;
60
61 //==============================================================================
69
79
82
89
91
94
97
99 inline bool isShiftDown() const noexcept { return testFlags (shiftModifier); }
100
108 inline bool isCtrlDown() const noexcept { return testFlags (ctrlModifier); }
109
111 inline bool isAltDown() const noexcept { return testFlags (altModifier); }
112
113 //==============================================================================
163
164 //==============================================================================
167
170
171 bool operator== (const ModifierKeys other) const noexcept { return flags == other.flags; }
172 bool operator!= (const ModifierKeys other) const noexcept { return flags != other.flags; }
173
174 //==============================================================================
176 inline int getRawFlags() const noexcept { return flags; }
177
178 JUCE_NODISCARD ModifierKeys withoutFlags (int rawFlagsToClear) const noexcept { return ModifierKeys (flags & ~rawFlagsToClear); }
179 JUCE_NODISCARD ModifierKeys withFlags (int rawFlagsToSet) const noexcept { return ModifierKeys (flags | rawFlagsToSet); }
180
182 bool testFlags (int flagsToTest) const noexcept { return (flags & flagsToTest) != 0; }
183
185 int getNumMouseButtonsDown() const noexcept;
186
187 //==============================================================================
190
198
205 static ModifierKeys getCurrentModifiersRealtime() noexcept;
206
207private:
208 int flags = 0;
209};
210
211} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
Definition juce_ModifierKeys.h:41
static ModifierKeys currentModifiers
Definition juce_ModifierKeys.h:189
bool isRightButtonDown() const noexcept
Definition juce_ModifierKeys.h:88
bool isAltDown() const noexcept
Definition juce_ModifierKeys.h:111
bool isAnyMouseButtonDown() const noexcept
Definition juce_ModifierKeys.h:93
int flags
Definition juce_ModifierKeys.h:208
JUCE_NODISCARD ModifierKeys withFlags(int rawFlagsToSet) const noexcept
Definition juce_ModifierKeys.h:179
bool testFlags(int flagsToTest) const noexcept
Definition juce_ModifierKeys.h:182
bool isCtrlDown() const noexcept
Definition juce_ModifierKeys.h:108
JUCE_NODISCARD ModifierKeys withoutFlags(int rawFlagsToClear) const noexcept
Definition juce_ModifierKeys.h:178
bool isLeftButtonDown() const noexcept
Definition juce_ModifierKeys.h:81
ModifierKeys(const ModifierKeys &)=default
ModifierKeys()=default
static ModifierKeys getCurrentModifiers() noexcept
Definition juce_ModifierKeys.h:197
JUCE_NODISCARD ModifierKeys withOnlyMouseButtons() const noexcept
Definition juce_ModifierKeys.h:166
bool isMiddleButtonDown() const noexcept
Definition juce_ModifierKeys.h:90
bool isCommandDown() const noexcept
Definition juce_ModifierKeys.h:68
int getRawFlags() const noexcept
Definition juce_ModifierKeys.h:176
JUCE_NODISCARD ModifierKeys withoutMouseButtons() const noexcept
Definition juce_ModifierKeys.h:169
bool isAnyModifierKeyDown() const noexcept
Definition juce_ModifierKeys.h:96
bool isPopupMenu() const noexcept
Definition juce_ModifierKeys.h:78
bool isShiftDown() const noexcept
Definition juce_ModifierKeys.h:99
Flags
Definition juce_ModifierKeys.h:116
@ ctrlAltCommandModifiers
Definition juce_ModifierKeys.h:161
@ ctrlModifier
Definition juce_ModifierKeys.h:124
@ commandModifier
Definition juce_ModifierKeys.h:147
@ shiftModifier
Definition juce_ModifierKeys.h:121
@ allMouseButtonModifiers
Definition juce_ModifierKeys.h:158
@ leftButtonModifier
Definition juce_ModifierKeys.h:130
@ middleButtonModifier
Definition juce_ModifierKeys.h:136
@ allKeyboardModifiers
Definition juce_ModifierKeys.h:155
@ popupMenuClickModifier
Definition juce_ModifierKeys.h:151
@ altModifier
Definition juce_ModifierKeys.h:127
@ noModifiers
Definition juce_ModifierKeys.h:118
@ rightButtonModifier
Definition juce_ModifierKeys.h:133
#define JUCE_NODISCARD
Definition juce_CompilerSupport.h:108
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
#define const
Definition zconf.h:137