Ejemplo n.º 1
0
void Fader::mousePressEvent(QMouseEvent *ev)
{
	if ( ev->button() == Qt::LeftButton && ev->modifiers() == Qt::ShiftModifier ){
		MidiSenseWidget midiSense( this, true, this->getAction() );
		midiSense.exec();
	}
}
Ejemplo n.º 2
0
void Knob::mousePressEvent(QMouseEvent *ev)
{
    if ( ev->button() == Qt::LeftButton && ev->modifiers() == Qt::ShiftModifier ){
	MidiSenseWidget midiSense( this, true, this->getAction() );
	midiSense.exec();
    }

    setCursor( QCursor( Qt::SizeVerCursor ) );

	m_fMousePressValue = m_fValue;
	m_fMousePressY = ev->y();
}
Ejemplo n.º 3
0
void Rotary::mousePressEvent(QMouseEvent *ev)
{
	setCursor( QCursor( Qt::SizeVerCursor ) );

	m_fMousePressValue = m_fValue;
	m_fMousePressY = ev->y();

	if ( m_bShowValueToolTip ) {
		char tmp[20];
		sprintf( tmp, "%#.2f", m_fValue );
		m_pValueToolTip->showTip( mapToGlobal( QPoint( -38, 1 ) ), QString( tmp ) );
	}

	if ( ev->button() == Qt::LeftButton && ev->modifiers() == Qt::ShiftModifier ){
		MidiSenseWidget midiSense( this, true, this->getAction() );
		midiSense.exec();
	}
}
Ejemplo n.º 4
0
void Button::mousePressEvent(QMouseEvent*ev) {

    /*
    *  Shift + Left-Click activate the midi learn widget
    */

    if ( ev->button() == Qt::LeftButton && (ev->modifiers() & Qt::ShiftModifier) ){
	    MidiSenseWidget midiSense( this, true, this->getAction() );
	    midiSense.exec();
	    return;
    }

    m_bPressed = true;
    update();
    emit mousePress(this);

	if ( ev->button() == Qt::LeftButton && __enable_press_hold) {
		m_timerTimeout = 2000;
		buttonPressed_timer_timeout();
	}
}
Ejemplo n.º 5
0
void ToggleButton::mousePressEvent(QMouseEvent *ev) {

	if ( ev->button() == Qt::LeftButton && ev->modifiers() == Qt::ShiftModifier ){
	    MidiSenseWidget midiSense( this, true, this->getAction() );
	    midiSense.exec();
	    return;
	}

	if (ev->button() == Qt::RightButton) {
                emit rightClicked(this);
        }
	else {
		if (m_bPressed) {
			m_bPressed = false;
		}
		else {
			m_bPressed = true;
		}
		update();

		emit clicked(this);
	}
}