void Button::handleButtonEvent(Input_Event e) { if (e.Event_Data[0] == MOUSE_DOWN) { onDown(); m_mouseDownOverElement = true; } else if (e.Event_Data[0] == MOUSE_UP) { if (m_mouseDownOverElement == true) { onUp(); } m_mouseDownOverElement = false; } else if (e.Event_Data[0] == MOUSE_MOTION) { m_mouseOverElement = true; } }
bool CameraDoubleTapHandler::onTouchEvent(const G3MEventContext *eventContext, const TouchEvent* touchEvent, CameraContext *cameraContext) { // only one finger needed if (touchEvent->getTouchCount()!=1) return false; if (touchEvent->getTapCount()!=2) return false; if (touchEvent->getType()!=Down) return false; onDown(eventContext, *touchEvent, cameraContext); return true; }
void SideBar::addToMenu( QMenu& menu ) { menu.addAction( ui.nowPlaying->text(), ui.nowPlaying, SLOT(click()), Qt::CTRL + Qt::Key_1); menu.addAction( ui.scrobbles->text(), ui.scrobbles, SLOT(click()), Qt::CTRL + Qt::Key_2); menu.addAction( ui.profile->text(), ui.profile, SLOT(click()), Qt::CTRL + Qt::Key_3); menu.addAction( ui.friends->text(), ui.friends, SLOT(click()), Qt::CTRL + Qt::Key_4); menu.addAction( ui.radio->text(), ui.radio, SLOT(click()), Qt::CTRL + Qt::Key_5); menu.addSeparator(); menu.addAction( "Next Section", this, SLOT(onDown()), Qt::CTRL + Qt::Key_BracketRight); menu.addAction( "Previous Section", this, SLOT(onUp()), Qt::CTRL + Qt::Key_BracketLeft); }
void SideBar::addToMenu( QMenu& menu ) { menu.addAction( ui.nowPlaying->text(), ui.nowPlaying, SLOT(click()), Qt::CTRL + Qt::Key_1); menu.addAction( ui.scrobbles->text(), ui.scrobbles, SLOT(click()), Qt::CTRL + Qt::Key_2); menu.addAction( ui.profile->text(), ui.profile, SLOT(click()), Qt::CTRL + Qt::Key_3); menu.addAction( ui.friends->text(), ui.friends, SLOT(click()), Qt::CTRL + Qt::Key_4); m_radioAction = menu.addAction( ui.radio->text(), ui.radio, SLOT(click()), Qt::CTRL + Qt::Key_5); m_radioAction->setVisible( !aApp->currentSession().isValid() || aApp->currentSession().subscriberRadio() ); menu.addSeparator(); menu.addAction( tr("Next Section"), this, SLOT(onDown()), Qt::CTRL + Qt::Key_BracketRight); menu.addAction( tr("Previous Section"), this, SLOT(onUp()), Qt::CTRL + Qt::Key_BracketLeft); }
/** * On command events (string parse) */ void onCommand(CString &cmd) { if (cmd == "right") { onRight(); } else if (cmd == "left") { onLeft(); } else if (cmd == "up") { onUp(); } else if (cmd == "down") { onDown(); } else if (cmd == "play") { onPlay(); } else if (cmd == "stop") { onStop(); } }
bool CameraRotationHandler::onTouchEvent(const G3MEventContext *eventContext, const TouchEvent* touchEvent, CameraContext *cameraContext) { // three finger needed if (touchEvent->getTouchCount()!=3) return false; switch (touchEvent->getType()) { case Down: onDown(eventContext, *touchEvent, cameraContext); break; case Move: onMove(eventContext, *touchEvent, cameraContext); break; case Up: onUp(eventContext, *touchEvent, cameraContext); default: break; } return true; }
* Destroys the object and frees any allocated resources */ keyDialog::~keyDialog() { } void keyDialog::connectSlots() { connect( ui.nameListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(onNamechange(int)) ); connect( ui.addButton, SIGNAL(clicked()), this, SLOT(onAdd()) ); connect( ui.deleteButton, SIGNAL(clicked()), this, SLOT(onDelete()) ); connect( ui.updateButton, SIGNAL(clicked()), this, SLOT(onUpdate()) ); connect( ui.closeButton, SIGNAL(clicked()), this, SLOT(onClose()) ); connect( ui.upButton, SIGNAL(clicked()), this, SLOT(onUp()) ); connect( ui.downButton, SIGNAL(clicked()), this, SLOT(onDown()) ); connect( ui.leftButton, SIGNAL(clicked()), this, SLOT(onLeft()) ); connect( ui.rightButton, SIGNAL(clicked()), this, SLOT(onRight()) ); connect( ui.enterButton, SIGNAL(clicked()), this, SLOT(onEnter()) ); connect( &bgKey, SIGNAL(buttonClicked(int)), this, SLOT(onSelect(int)) ); connect( ui.scriptButton, SIGNAL(clicked()), this, SLOT(onScript()) ); connect( ui.programButton, SIGNAL(clicked()), this, SLOT(onProgram()) ); } void keyDialog::onNamechange( int item ) { loadKey(item); } void keyDialog::onAdd()