int main(int argc, char *argv[]) { int PIN = 2; if(wiringPiSetup() == -1) return 0; mySwitch = RCSwitch(); mySwitch.enableReceive(PIN); // Receiver on inerrupt 0 => that is pin #2 while(1) { if (mySwitch.available()) { int value = mySwitch.getReceivedValue(); if (value == 0) { printf("Unknown encoding"); } else { printf("Received %i\n", mySwitch.getReceivedValue() ); send_motion(value); } mySwitch.resetAvailable(); } sleep(1.5); } exit(0); }
void Touch::sendMotion(int touch_id, const QPointF &position) { if (!m_focusResource) return; send_motion(m_focusResource->handle, Compositor::currentTimeMsecs(), touch_id, wl_fixed_from_double(position.x()), wl_fixed_from_double(position.y())); }
void Pointer::sendMotion(const QPoint &pos) { if (m_focusResource) send_motion(m_focusResource->handle, m_compositor->time(), wl_fixed_from_int(pos.x()), wl_fixed_from_int(pos.y())); }