macOS: Change drag copy shortcut from Command to Option (#7325)
macOS: Replace Command + Drag shortcut key with Option + Drag Add new header `KeyboardShortcuts.h` for platform-specific keyboard mappings --------- Co-authored-by: Michael Gregorius <michael.gregorius.git@arcor.de>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "AutomationNode.h"
|
||||
#include "AutomationClipView.h"
|
||||
#include "AutomationTrack.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "LocaleHelper.h"
|
||||
#include "Note.h"
|
||||
#include "PatternStore.h"
|
||||
@@ -952,7 +953,7 @@ QString AutomationClip::name() const
|
||||
{
|
||||
return m_objects.front()->fullDisplayName();
|
||||
}
|
||||
return tr( "Drag a control while pressing <%1>" ).arg(UI_CTRL_KEY);
|
||||
return tr( "Drag a control while pressing <%1>" ).arg(UI_COPY_KEY);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "ControllerConnection.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "MainWindow.h"
|
||||
#include "StringPairDrag.h"
|
||||
#include "Clipboard.h"
|
||||
@@ -171,7 +172,7 @@ void AutomatableModelView::unsetModel()
|
||||
|
||||
void AutomatableModelView::mousePressEvent( QMouseEvent* event )
|
||||
{
|
||||
if( event->button() == Qt::LeftButton && event->modifiers() & Qt::ControlModifier )
|
||||
if (event->button() == Qt::LeftButton && event->modifiers() & KBD_COPY_MODIFIER)
|
||||
{
|
||||
new gui::StringPairDrag( "automatable_model", QString::number( modelUntyped()->id() ), QPixmap(), widget() );
|
||||
event->accept();
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "InstrumentTrackWindow.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "MainWindow.h"
|
||||
#include "PatternStore.h"
|
||||
#include "PluginFactory.h"
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "MainWindow.h"
|
||||
#include "Song.h"
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ StringPairDrag::StringPairDrag( const QString & _key, const QString & _value,
|
||||
auto m = new QMimeData();
|
||||
m->setData( mimeType( MimeType::StringPair ), txt.toUtf8() );
|
||||
setMimeData( m );
|
||||
exec( Qt::LinkAction, Qt::LinkAction );
|
||||
exec( Qt::CopyAction, Qt::CopyAction );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "GuiApplication.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "InstrumentTrackView.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "MidiClip.h"
|
||||
#include "MidiClipView.h"
|
||||
#include "Note.h"
|
||||
@@ -633,7 +634,7 @@ void ClipView::mousePressEvent( QMouseEvent * me )
|
||||
auto pClip = dynamic_cast<PatternClip*>(m_clip);
|
||||
const bool knifeMode = m_trackView->trackContainerView()->knifeMode();
|
||||
|
||||
if ( me->modifiers() & Qt::ControlModifier && !(sClip && knifeMode) )
|
||||
if (me->modifiers() & KBD_COPY_MODIFIER && !(sClip && knifeMode))
|
||||
{
|
||||
if( isSelected() )
|
||||
{
|
||||
@@ -726,7 +727,7 @@ void ClipView::mousePressEvent( QMouseEvent * me )
|
||||
QString hint = m_action == Action::Move || m_action == Action::MoveSelection
|
||||
? tr( "Press <%1> and drag to make a copy." )
|
||||
: tr( "Press <%1> for free resizing." );
|
||||
m_hint = TextFloat::displayMessage( tr( "Hint" ), hint.arg(UI_CTRL_KEY),
|
||||
m_hint = TextFloat::displayMessage( tr( "Hint" ), hint.arg(UI_COPY_KEY),
|
||||
embed::getIconPixmap( "hint" ), 0 );
|
||||
}
|
||||
}
|
||||
@@ -824,7 +825,7 @@ void ClipView::mouseMoveEvent( QMouseEvent * me )
|
||||
}
|
||||
}
|
||||
|
||||
if( me->modifiers() & Qt::ControlModifier )
|
||||
if (me->modifiers() & KBD_COPY_MODIFIER)
|
||||
{
|
||||
delete m_hint;
|
||||
m_hint = nullptr;
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "GuiApplication.h"
|
||||
#include "FontHelper.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MidiClip.h"
|
||||
#include "PatternStore.h"
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "ConfigManager.h"
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "NStateButton.h"
|
||||
#include "TextFloat.h"
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "embed.h"
|
||||
#include "Engine.h"
|
||||
#include "InstrumentTrackView.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "PixmapButton.h"
|
||||
#include "Song.h"
|
||||
#include "StringPairDrag.h"
|
||||
@@ -180,9 +181,8 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) :
|
||||
*/
|
||||
void TrackOperationsWidget::mousePressEvent( QMouseEvent * me )
|
||||
{
|
||||
if( me->button() == Qt::LeftButton &&
|
||||
me->modifiers() & Qt::ControlModifier &&
|
||||
m_trackView->getTrack()->type() != Track::Type::Pattern)
|
||||
if (me->button() == Qt::LeftButton && me->modifiers() & KBD_COPY_MODIFIER &&
|
||||
m_trackView->getTrack()->type() != Track::Type::Pattern)
|
||||
{
|
||||
DataFile dataFile( DataFile::Type::DragNDropData );
|
||||
m_trackView->getTrack()->saveState( dataFile, dataFile.content() );
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "embed.h"
|
||||
#include "CaptionMenu.h"
|
||||
#include "ConfigManager.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "SimpleTextFloat.h"
|
||||
|
||||
namespace lmms::gui
|
||||
@@ -125,7 +126,7 @@ void Fader::mouseMoveEvent(QMouseEvent* mouseEvent)
|
||||
void Fader::mousePressEvent(QMouseEvent* mouseEvent)
|
||||
{
|
||||
if (mouseEvent->button() == Qt::LeftButton &&
|
||||
!(mouseEvent->modifiers() & Qt::ControlModifier))
|
||||
!(mouseEvent->modifiers() & KBD_COPY_MODIFIER))
|
||||
{
|
||||
AutomatableModel* thisModel = model();
|
||||
if (thisModel)
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "CaptionMenu.h"
|
||||
#include "ControllerConnection.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "LocaleHelper.h"
|
||||
#include "MainWindow.h"
|
||||
#include "ProjectJournal.h"
|
||||
@@ -155,7 +156,7 @@ void FloatModelEditorBase::dropEvent(QDropEvent * de)
|
||||
void FloatModelEditorBase::mousePressEvent(QMouseEvent * me)
|
||||
{
|
||||
if (me->button() == Qt::LeftButton &&
|
||||
! (me->modifiers() & Qt::ControlModifier) &&
|
||||
! (me->modifiers() & KBD_COPY_MODIFIER) &&
|
||||
! (me->modifiers() & Qt::ShiftModifier))
|
||||
{
|
||||
AutomatableModel *thisModel = model();
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "embed.h"
|
||||
#include "GuiApplication.h"
|
||||
#include "FontHelper.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "MainWindow.h"
|
||||
#include "lmms_math.h"
|
||||
|
||||
@@ -139,7 +140,7 @@ void LcdFloatSpinBox::mousePressEvent(QMouseEvent* event)
|
||||
m_intStep = event->x() < m_wholeDisplay.width();
|
||||
|
||||
if (event->button() == Qt::LeftButton &&
|
||||
!(event->modifiers() & Qt::ControlModifier) &&
|
||||
!(event->modifiers() & KBD_COPY_MODIFIER) &&
|
||||
event->y() < m_wholeDisplay.cellHeight() + 2)
|
||||
{
|
||||
m_mouseMoving = true;
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <QInputDialog>
|
||||
|
||||
#include "LcdSpinBox.h"
|
||||
#include "KeyboardShortcuts.h"
|
||||
#include "CaptionMenu.h"
|
||||
|
||||
|
||||
@@ -79,7 +80,7 @@ void LcdSpinBox::contextMenuEvent(QContextMenuEvent* event)
|
||||
void LcdSpinBox::mousePressEvent( QMouseEvent* event )
|
||||
{
|
||||
if( event->button() == Qt::LeftButton &&
|
||||
! ( event->modifiers() & Qt::ControlModifier ) &&
|
||||
! (event->modifiers() & KBD_COPY_MODIFIER) &&
|
||||
event->y() < cellHeight() + 2 )
|
||||
{
|
||||
m_mouseMoving = true;
|
||||
|
||||
Reference in New Issue
Block a user