PianoRoll arrow key behaviour tweaks

* Ctrl + Left/Right moves selected notes by one bar
  (Old behaviour was to move the playnote)
  Closes #811
* Shift + Up/Down moves selected nodes by one semitone
  (Old behaviour was to ignore the Shift key and move the viewport)
  Closes #810
This commit is contained in:
Lukas W
2014-11-21 14:41:31 +01:00
parent 941ed33248
commit 22ec15f2d7

View File

@@ -1232,6 +1232,11 @@ void PianoRoll::keyPressEvent( QKeyEvent* event )
// if nothing selected, shift _everything_
shiftSemiTone( +12 );
}
else if((event->modifiers() & Qt::ShiftModifier) && m_action == ActionNone)
{
// Move selected notes up by one semitone
shiftSemiTone( 1 );
}
else
{
// scroll
@@ -1259,6 +1264,11 @@ void PianoRoll::keyPressEvent( QKeyEvent* event )
// if nothing selected, shift _everything_
shiftSemiTone( -12 );
}
else if((event->modifiers() & Qt::ShiftModifier) && m_action == ActionNone)
{
// Move selected notes down by one semitone
shiftSemiTone( -1 );
}
else
{
// scroll
@@ -1282,12 +1292,8 @@ void PianoRoll::keyPressEvent( QKeyEvent* event )
case Qt::Key_Left:
if( event->modifiers() & Qt::ControlModifier && m_action == ActionNone )
{
// move time ticker
if( ( m_timeLine->pos() -= 16 ) < 0 )
{
m_timeLine->pos().setTicks( 0 );
}
m_timeLine->updatePosition();
// Move selected notes by one bar to the left
shiftPos( - MidiTime::ticksPerTact() );
}
else if( event->modifiers() & Qt::ShiftModifier && m_action == ActionNone)
{
@@ -1320,9 +1326,8 @@ void PianoRoll::keyPressEvent( QKeyEvent* event )
case Qt::Key_Right:
if( event->modifiers() & Qt::ControlModifier && m_action == ActionNone)
{
// move time ticker
m_timeLine->pos() += 16;
m_timeLine->updatePosition();
// Move selected notes by one bar to the right
shiftPos( MidiTime::ticksPerTact() );
}
else if( event->modifiers() & Qt::ShiftModifier && m_action == ActionNone)
{