コード例 #1
0
ファイル: RFSniffer.cpp プロジェクト: LesGeeksDuDimanche/huby
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);


}
コード例 #2
0
ファイル: qwltouch.cpp プロジェクト: locusf/qtwayland
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()));
}
コード例 #3
0
ファイル: mockinput.cpp プロジェクト: venkatarajasekhar/Qt
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()));
}