Fix scrolling direction in SongEditor due to stuck Ctrl/Shift.

This commit is contained in:
Cyp
2019-10-29 16:53:17 +01:00
committed by Johannes Lorenz
parent d849cc179c
commit 42f7e262e9
7 changed files with 16 additions and 25 deletions

View File

@@ -694,7 +694,7 @@ void TrackContentObjectView::mousePressEvent( QMouseEvent * me )
dataFile.toString(), thumbnail, this );
}
else if( me->button() == Qt::LeftButton &&
/* engine::mainWindow()->isShiftPressed() == false &&*/
/* (me->modifiers() & Qt::ShiftModifier) &&*/
fixedTCOs() == false )
{
m_tco->addJournalCheckPoint();

View File

@@ -1423,6 +1423,7 @@ void MainWindow::sessionCleanup()
void MainWindow::focusOutEvent( QFocusEvent * _fe )
{
// TODO Remove this function, since it is apparently never actually called!
// when loosing focus we do not receive key-(release!)-events anymore,
// so we might miss release-events of one the modifiers we're watching!
clearKeyModifiers();

View File

@@ -415,14 +415,13 @@ void SongEditor::setEditModeSelect()
void SongEditor::keyPressEvent( QKeyEvent * ke )
{
if( /*_ke->modifiers() & Qt::ShiftModifier*/
gui->mainWindow()->isShiftPressed() == true &&
bool isShiftPressed = ke->modifiers() & Qt::ShiftModifier;
if( isShiftPressed &&
( ke->key() == Qt::Key_Insert || ke->key() == Qt::Key_Enter || ke->key() == Qt::Key_Return ) )
{
m_song->insertBar();
}
else if(/* _ke->modifiers() & Qt::ShiftModifier &&*/
gui->mainWindow()->isShiftPressed() == true &&
else if( isShiftPressed &&
( ke->key() == Qt::Key_Delete || ke->key() == Qt::Key_Backspace ) )
{
m_song->removeBar();
@@ -458,7 +457,7 @@ void SongEditor::keyPressEvent( QKeyEvent * ke )
void SongEditor::wheelEvent( QWheelEvent * we )
{
if( gui->mainWindow()->isCtrlPressed() == true )
if( we->modifiers() & Qt::ControlModifier )
{
int z = m_zoomingModel->value();
@@ -480,7 +479,7 @@ void SongEditor::wheelEvent( QWheelEvent * we )
// and make sure, all TCO's are resized and relocated
realignTracks();
}
else if( gui->mainWindow()->isShiftPressed() == true || we->orientation() == Qt::Horizontal )
else if( (we->modifiers() & Qt::ShiftModifier) || we->orientation() == Qt::Horizontal )
{
m_leftRightScroll->setValue( m_leftRightScroll->value() -
we->delta() / 30 );

View File

@@ -601,7 +601,7 @@ void Knob::mousePressEvent( QMouseEvent * _me )
m_buttonPressed = true;
}
else if( _me->button() == Qt::LeftButton &&
gui->mainWindow()->isShiftPressed() == true )
(_me->modifiers() & Qt::ShiftModifier) )
{
new StringPairDrag( "float_value",
QString::number( model()->value() ),

View File

@@ -122,7 +122,7 @@ void LcdSpinBox::mouseMoveEvent( QMouseEvent* event )
if( m_mouseMoving )
{
int dy = event->globalY() - m_origMousePos.y();
if( gui->mainWindow()->isShiftPressed() )
if( event->modifiers() & Qt::ShiftModifier )
dy = qBound( -4, dy/4, 4 );
if( dy > 1 || dy < -1 )
{