void KeyboardManager::onKeyReleased(const EventKeyboard::KeyCode keyCode, const Event* event) {
  auto key = findKey(keyCode);
  _pressedKeys &= ~static_cast<Keys>(key);

  if (onReleased != nullptr) {
    onReleased(key);
  }
}
FadePedal::FadePedal(QWidget *parent)
	: FadeButton(parent)
	, m_State(STATE_IDLE)
	, m_Elapsed(0)
	, m_UpDuration(250)
	, m_DownDuration(1000)
{
	connect(this, SIGNAL(pressed()), this, SLOT(onPressed()));
	connect(this, SIGNAL(released()), this, SLOT(onReleased()));
}
ToyButtonWidget::ToyButtonWidget(QWidget *parent)
	: ToyWidget(parent)
{
	m_HelpText = tr("Min = Button Down\nMax = Button Up\n\nOSC Trigger:\nNo Arguments = Click\nArgument(1) = Press\nArgument(0) = Release");

	m_Widget = new FadeButton(this);
	connect(m_Widget, SIGNAL(pressed()), this, SLOT(onPressed()));
	connect(m_Widget, SIGNAL(released()), this, SLOT(onReleased()));
	
	QPalette pal( m_Widget->palette() );
	m_Color = pal.color(QPalette::Button);
	m_TextColor = pal.color(QPalette::ButtonText);
}
ParameterSlider::ParameterSlider(QWidget *parent, ParameterObject *parameterobject, DescLoD descriptionLoD)
	: ParameterVirtualWidget(parent, parameterobject, descriptionLoD)
{
	this->pressed = true;
	this->suppressUpdate=false;

	setValue();
	connect(slider, SIGNAL(sliderPressed()), this, SLOT(onPressed()));
	connect(slider, SIGNAL(sliderReleased()), this, SLOT(onReleased()));
	connect(slider, SIGNAL(valueChanged(int)), this, SLOT(onSliderChanged(int)));
	connect(doubleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onSpinBoxChanged(double)));
	connect(doubleSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));

	IgnoreWheelWhenNotFocused *ignoreWheelWhenNotFocused = new IgnoreWheelWhenNotFocused(this);
	slider->installEventFilter(ignoreWheelWhenNotFocused);
	doubleSpinBox->installEventFilter(ignoreWheelWhenNotFocused);
}
int MoodBox::ContactListButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QToolButton::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: update((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 1: updateImage(); break;
        case 2: onPressed(); break;
        case 3: onReleased(); break;
        default: ;
        }
        _id -= 4;
    }
    return _id;
}