gearmulator

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs
Log | Files | Refs | Submodules | README | LICENSE

commit bf2ac82ebb8b6e155b41a14e47d540cd73a7f5fd
parent 3719c0e6d88c074fa4a451f3cfcde7567d9aa29a
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date:   Sun, 29 Sep 2024 00:29:32 +0200

add ability to ask button if last click was a right click

Diffstat:
Msource/juceUiLib/button.h | 18++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/source/juceUiLib/button.h b/source/juceUiLib/button.h @@ -40,8 +40,16 @@ namespace genericUI if(onUp && onUp(_e)) return; - if (!allowRightClick() && _e.mods.isPopupMenu()) - return; + if(_e.mods.isPopupMenu()) + { + if(!allowRightClick()) + return; + m_isRightClick = true; + } + else + { + m_isRightClick = false; + } T::mouseUp(_e); } @@ -80,11 +88,17 @@ namespace genericUI m_hitAreaOffset = _offset; } + bool isRightClick() const + { + return m_isRightClick; + } + Callback onDown; Callback onUp; private: bool m_allowRightClick = false; + bool m_isRightClick = false; juce::Rectangle<int> m_hitAreaOffset{0,0,0,0}; }; } \ No newline at end of file