Exemplo n.º 1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    setAttribute(Qt::WA_AcceptTouchEvents);
    installEventFilter(ui->btn_left);
    installEventFilter(ui->btn_right);
    installEventFilter(ui->btn_up);

    connect(ui->btn_left, SIGNAL(Pressed()), this, SLOT(ClickLeft()));
    connect(ui->btn_left, SIGNAL(Released()), this, SLOT(ReleaseLeftRight()));
    connect(ui->btn_right, SIGNAL(Pressed()), this, SLOT(ClickRight()));
    connect(ui->btn_right, SIGNAL(Released()), this, SLOT(ReleaseLeftRight()));
    connect(ui->btn_up, SIGNAL(Pressed()), this, SLOT(ClickUp()));
    connect(ui->btn_up, SIGNAL(Released()), this, SLOT(ReleaseUp()));

    ui->btn_left->RotateImage(90);
    ui->btn_right->RotateImage(-90);
    ui->btn_up->RotateImage(180);

    engine = new GameEngine(this);
    engine->setCamera(ui->graphicsView);
    engine->InitScene(":/map/map_tank.tmx");

    ui->summary->setVisible(false);
    ui->summary->setText("Tanque\tDisparo\tAcerto\tMorte");

    connect(ui->toolButton, SIGNAL(pressed()), this, SLOT(SwapSummary()));
}
Exemplo n.º 2
0
//! Send a byte (effective for serial TX only)
PortUX::PortAccessStatus PortUX::PTx(wxUint8 pValue)
{
   if (Released()) return IPAC_PortReleased;

	m_lastError = IPAC_Success;
	if ( ! IsPortSerial() ) {
      m_lastError = IPAC_NotSupported; return m_lastError; // ERROR EXIT
	}
	if (m_SerialPort_Handle <0) {
		m_lastError = IPAC_NoInterface; return m_lastError; // ERROR EXIT
	}


	wxUint8 szBuf = pValue;
	ssize_t dwOutgoingWriteSize;

    // we have non blocking IO - check if we can write
    dwOutgoingWriteSize = ::write(m_SerialPort_Handle, &szBuf, 1); // write bytewise
    // writesize can be:
    //    >0 (a caracter is written)
    //    =0 (end of file - note this is true only once the it becomes <0 !!)
    //    <0 (an error condition)
	if(dwOutgoingWriteSize > 0) {
		wxASSERT(dwOutgoingWriteSize == 1);	// hmmm expected only one char ???!
	}
	else  {
		// this indicated EOF - which is a closed FD of a tty device
    // must close this connection
		m_lastError = IPAC_PutFailed;
	}

    return m_lastError;
}
Exemplo n.º 3
0
//! Receive a byte (effective for serial RX only)
PortUX::PortAccessStatus PortUX::PRx(wxUint8& pValue)
{
   if (Released()) return IPAC_PortReleased;

	m_lastError = IPAC_Success;
	if ( ! IsPortSerial() ) {
      m_lastError = IPAC_NotSupported; return m_lastError; // ERROR EXIT
	}
	if (m_SerialPort_Handle <0) {
		m_lastError = IPAC_NoInterface; return m_lastError; // ERROR EXIT
	}


	// read one character
	wxUint8 szBuf;
	ssize_t dwIncommingReadSize;

    // we have non blocking IO - check for data available
    dwIncommingReadSize = ::read(m_SerialPort_Handle, &szBuf, 1); // read bytewise
    // readsize can be:
    //    >0 (a caracter is read)
    //    =0 (end of file - note this is true only once the it becomes <0 !!)
    //    <0 (an error condition)
	if(dwIncommingReadSize > 0) {
		wxASSERT(dwIncommingReadSize == 1);	// hmmm expected only one char ???!
		pValue = szBuf;
	}
	else {
		// this is timeout 'cause of any reason
        m_lastError = IPAC_GetFailed;
	}

  return m_lastError;

}
Exemplo n.º 4
0
//-----------------------------------------------------------------------------
// Name : HandleMouse() 
//-----------------------------------------------------------------------------
bool CSliderUI::HandleMouse( HWND hWnd, UINT uMsg, POINT mousePoint, INPUT_STATE inputstate, CTimer* timer )
{
	if( !m_bEnabled || !m_bVisible )
		return false;

	switch( uMsg )
	{
	case WM_LBUTTONDOWN:
	case WM_LBUTTONDBLCLK:
		{
			if ( Pressed(hWnd, mousePoint, inputstate, timer))
				return true;
		}break;

	case WM_LBUTTONUP:
		{
			if ( Released(hWnd, mousePoint))
				return true;
		}break;

	case WM_MOUSEMOVE:
		{
			if ( Dragged(mousePoint))
				return true;
		}break;

	case WM_MOUSEWHEEL:
		{
			if ( Scrolled( inputstate.nScrollAmount ) )
				return true;
		}break;
	};

	return false;
}
Exemplo n.º 5
0
//! Set the ports handshake (effective for serial RX/TX only)
PortUX::PortAccessStatus PortUX::PSetHandshake(EHandshake handshake)
{
   if (Released()) return IPAC_PortReleased;

	m_lastError = IPAC_Success;
	if ( ! IsPortSerial() ) {
      m_lastError = IPAC_NotSupported; return m_lastError; // ERROR EXIT
	}
	if (m_SerialPort_Handle <0) {
		m_lastError = IPAC_NoInterface; return m_lastError; // ERROR EXIT
	}


   wxPort::SetHandshake(handshake); //BM must persist here...

   // a quick check wether the COM is available at all
   struct termios mode;
   ::memset(&mode, 0, sizeof(mode));
   if (::tcgetattr(m_SerialPort_Handle, &mode) != 0) {
      m_lastError = IPAC_CommSetupFailed; return m_lastError; // ERROR EXIT
   }

   // just translate into UX handshake
   switch (handshake) {
      case ELD_None:
         mode.c_iflag &= ~IXON;   // Enable XON/XOFF flow control on output.
         mode.c_iflag &= ~IXOFF;  // Enable XON/XOFF flow control on input
         mode.c_cflag &= ~CRTSCTS; // Not RTS CTS
       break;

      case ELD_SW:
         mode.c_iflag |= IXON;   // Enable XON/XOFF flow control on output.
         mode.c_iflag |= IXOFF;  // Enable XON/XOFF flow control on input
         mode.c_cflag &= ~CRTSCTS; // Not RTS CTS
       break;

      case ELD_HW:
         mode.c_iflag &= ~IXON;   // Enable XON/XOFF flow control on output.
         mode.c_iflag &= ~IXOFF;  // Enable XON/XOFF flow control on input
         mode.c_cflag |= CRTSCTS; // Not RTS CTS
       break;

      case ELD_LAST:
      default:
         m_lastError = IPAC_CommSetupFailed; return m_lastError; // ERROR EXIT
   }// switch

   // now set the mode
   ::tcflush(m_SerialPort_Handle, TCIOFLUSH);
   if (::tcsetattr(m_SerialPort_Handle, TCSANOW, &mode) == 0) {
      ; //OK
   }
   else {
      m_lastError = IPAC_CommSetupFailed;
   }
   return m_lastError;
}
/*!
   \brief Overriden to catch mouseReleaseEvents and to stop the internal timer.
*/
void RenderWindowInteractor::mouseReleaseEvent( QMouseEvent *event ) {
   if( this->mouseEventActive ) {
      this->stepTimer->stop();
      this->mouseEventActive = false;
      QObject::disconnect( this->stepTimer, 0, this, 0 );
   }

   emit( Released(event->x(), this->height() - event->y()) );

}
Exemplo n.º 7
0
/////////////////////////////////////////////////////////////////////////////
//
// Sets the Byte at port portAddress
//
PortUX::PortAccessStatus PortUX::put_port(wxUint8  outByte)
{
   if (Released()) return IPAC_PortReleased;

	if ( ! IsPortParallel() ) {
      m_lastError = IPAC_NotSupported;
	}

	if ( IsPortParallel() ) {

      m_lastError = IPAC_Success;
      if (m_ParallelPort_Handle <0) {
         m_lastError = IPAC_NoInterface;
         return m_lastError;
      }

       int iocMode;

       iocMode = 0; //  null = Forward Direction
       if ( xioctl(m_ParallelPort_Handle, PPDATADIR, &iocMode) <0 ) {
         m_lastError = IPAC_PutFailed;
       }
       else {
           if ( xioctl(m_ParallelPort_Handle, PPWDATA, &outByte) <0) {
               m_lastError = IPAC_PutFailed;
           }
      }
   }
   else if (IsPortGPUSB()) {
      m_lastError = IPAC_Success;
      if (m_pGpUsb == NULL) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }
      m_pGpUsb->SetValue((unsigned short)(outByte));
   }

   else if (IsPortLXUSB()) {
      m_lastError = IPAC_Success;
      if (m_pLxUsb == NULL) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }
      m_pLxUsb->SetValue((unsigned short)(outByte));
   }

   else {
      // other ports
      m_lastError = IPAC_NotSupported;
   }

	return m_lastError;
}
Exemplo n.º 8
0
/////////////////////////////////////////////////////////////////////////////
//
// Sets the Byte at port portAddress
//
// returns:
// S_OK
// E_NOINTERFACE	if access was not started or failed
// E_FAIL			if something went wrong
//
PortW32::PortAccessStatus PortW32::put_port(wxUint8 outByte)
{
   if (Released()) return IPAC_PortReleased;

	if ( IsPortParallel() ) {
      m_lastError = IPAC_Success;
      if (m_PortTalk_Handle == INVALID_HANDLE_VALUE) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }
      if (m_portAddress == 0) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }

      if (m_ProtectedOS) {
         BOOL        success;
         BYTE        buffer[3];
         PUSHORT     pmyPort = (PUSHORT)&buffer[0];
         PBYTE       pmyByte = (PBYTE)&buffer[2];
         DWORD       bytesReturned;

         *pmyPort = (USHORT)m_portAddress;
         *pmyByte = outByte;

         success = DeviceIoControl(m_PortTalk_Handle,
                           (DWORD)IOCTL_WRITE_PORT_UCHAR,
                           &buffer, sizeof(buffer),
                           NULL, 0, &bytesReturned,
                           NULL);

         if (!success)
            //printf("Error occured during inportb while talking to PortTalk driver %d\n",GetLastError());
            m_lastError = IPAC_PutFailed;
      }

      else {
         // raw port access
         USHORT myPort = (USHORT)m_portAddress;
         BYTE   myByte = outByte;
         __asm
         {
            mov al, myByte
            mov dx, myPort
            out dx, al
         }
      }
   }

   else if (IsPortGPUSB()) {
Exemplo n.º 9
0
void PortUX::DTR(wxUint8 outByte)
{
   if (Released()) return;

   if ( ! IsPortSerial() ) {
      m_lastError = IPAC_NotSupported;
   }

   m_lastError = IPAC_Success;
   if (m_SerialPort_Handle <0) {
      m_lastError = IPAC_NoInterface;
      return;
   }

   int ioctx = TIOCM_DTR;  // which one
   int iocmd = (outByte==0) ? TIOCMBIC : TIOCMBIS; // Clear or Set bit
   if ( xioctl( m_SerialPort_Handle, iocmd, &ioctx )<0 ) {
      m_lastError = IPAC_CommLineStatFailed;
   }

}
Exemplo n.º 10
0
//! Set the rw timeout (if supported)
PortUX::PortAccessStatus PortUX::PSetTimeout(long toInMS, long toOutMS)
{
   if (Released()) return IPAC_PortReleased;

	m_lastError = IPAC_Success;
	if ( IsPortSerial() ) {
      if (m_SerialPort_Handle <0) {
         m_lastError = IPAC_NoInterface; return m_lastError; // ERROR EXIT
      }

      // a quick check wether the COM is available at all
      termios mode;
      ::memset(&mode, 0, sizeof(mode));
      if (::tcgetattr(m_SerialPort_Handle, &mode) != 0) {
         m_lastError = IPAC_CommSetupFailed; return m_lastError; // ERROR EXIT
      }

      cc_t vt = (cc_t)(toInMS/100); vt = (vt<1)?1:vt;
      mode.c_cc[VMIN] = 0;
      mode.c_cc[VTIME] = vt; // *.1 sec
      // If MIN = 0 and TIME > 0, TIME serves as a timeout value.
      // The read will be satisfied if a single character is read, or TIME is exceeded (t = TIME *0.1 s).
      // If TIME is exceeded, no character will be returned.

      // now set the mode
      ::tcflush(m_SerialPort_Handle, TCIOFLUSH);
      if (::tcsetattr(m_SerialPort_Handle, TCSANOW, &mode) == 0) {
         ; //OK
      }
      else {
         m_lastError = IPAC_CommSetupFailed;
      }
	}
	else if ( IsPortParallel() ) {
		// not avail - just exit with success
	}
   return m_lastError;
}
Exemplo n.º 11
0
wxUint8 PortUX::RING()
{
   if (Released()) return 0;

   if ( ! IsPortSerial() ) {
      m_lastError = IPAC_NotSupported;
   }

   m_lastError = IPAC_Success;
   if (m_SerialPort_Handle <0) {
      m_lastError = IPAC_NoInterface;
      return 0;
   }

   int ioctx;
   if ( xioctl( m_SerialPort_Handle, TIOCMGET, &ioctx )<0 ) {
      m_lastError = IPAC_CommLineStatFailed;
      return 0;
   }
   else {
      return ((ioctx & TIOCM_RNG)==TIOCM_RNG) ? 1 : 0;
   }
}
Exemplo n.º 12
0
/////////////////////////////////////////////////////////////////////////////
//
// Returns the Byte at port portAddress
//
PortW32::PortAccessStatus PortW32::get_port(wxUint8& inByte)
{
   if (Released()) return IPAC_PortReleased;

	if ( IsPortParallel() ) {
      m_lastError = IPAC_Success;
      if (m_PortTalk_Handle == INVALID_HANDLE_VALUE) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }
      if (m_portAddress == 0) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }

      if (m_ProtectedOS) {
         BOOL        success;
         USHORT      myPort = (USHORT)m_portAddress;
         BYTE        myByte = 0;
         DWORD       bytesReturned;

         success = DeviceIoControl(m_PortTalk_Handle,
                           (DWORD)IOCTL_READ_PORT_UCHAR,
                           &myPort, sizeof(myPort),                  /*in data*/
                           &myByte, sizeof(myByte), &bytesReturned,  /*out data*/
                           NULL);

         if (!success)
            //printf("Error occured during inportb while talking to PortTalk driver %d\n",GetLastError());
            m_lastError = IPAC_GetFailed;
         else
            inByte = myByte;
      }

      else {
         // raw port access
         USHORT myPort = (USHORT)m_portAddress;
         BYTE   myByte = 0;
         __asm
         {
            mov dx, myPort
            in  al, dx
            mov myByte, al
         }
         inByte = myByte;
      }
   }

   else if (IsPortGPUSB()) {
      m_lastError = IPAC_Success;
      if (m_pGpUsb == NULL) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }
      unsigned short val;
      m_pGpUsb->GetValue(val);
      inByte = wxUint8(val & 0xff);
   }

   else if (IsPortLXUSB()) {
      m_lastError = IPAC_Success;
      if (m_pLxUsb == NULL) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }
      unsigned short val;
      m_pLxUsb->GetValue(val);
      inByte = wxUint8(val & 0xff);
   }

   else {
      // other ports
      m_lastError = IPAC_NotSupported;
   }

	return m_lastError;

}//END Get
Exemplo n.º 13
0
/////////////////////////////////////////////////////////////////////////////
//
// Returns the outgoing Byte at port portAddress
PortUX::PortAccessStatus PortUX::get_port(wxUint8 &inByte)
{
   inByte=0; // default

   if (Released()) return IPAC_PortReleased;

	if ( IsPortParallel() ) {

      m_lastError = IPAC_Success;
      if (m_ParallelPort_Handle <0) {
         m_lastError = IPAC_NoInterface;
         return m_lastError;
      }

       int iocMode;
       wxUint8 cIn;

       iocMode = 0; // null = Forward Direction registers
       if ( xioctl(m_ParallelPort_Handle, PPDATADIR, &iocMode) <0 ) {
         m_lastError = IPAC_GetFailed;
       }
       else {
           if ( xioctl(m_ParallelPort_Handle, PPRDATA, &cIn) <0) {
               m_lastError = IPAC_GetFailed;
           }
           else {
               inByte = cIn;
           }
      }
   }

   else if (IsPortGPUSB()) {
      m_lastError = IPAC_Success;
      if (m_pGpUsb == NULL) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }
      unsigned short val;
      m_pGpUsb->GetValue(val);
      inByte = wxUint8(val & 0xff);
   }

   else if (IsPortLXUSB()) {
      m_lastError = IPAC_Success;
      if (m_pLxUsb == NULL) {
         m_lastError = IPAC_NoInterface;
         return m_lastError; // ERROR EXIT
      }
      unsigned short val;
      m_pLxUsb->GetValue(val);
      inByte = wxUint8(val & 0xff);
   }

   else {
      // other ports
      m_lastError = IPAC_NotSupported;
   }

	return m_lastError;

}
Exemplo n.º 14
0
void GamepadInputDevice::OnReleased(InputDeviceButton button)
{
    Released(button);
}
Exemplo n.º 15
0
//! Set the ports bauderate (effective for serial RX/TX only)
PortUX::PortAccessStatus PortUX::PSetBaudrate(EBaudRate baudrate)
{
   if (Released()) return IPAC_PortReleased;

	m_lastError = IPAC_Success;
	if ( ! IsPortSerial() ) {
      m_lastError = IPAC_NotSupported; return m_lastError; // ERROR EXIT
	}
	if (m_SerialPort_Handle <0) {
		m_lastError = IPAC_NoInterface; return m_lastError; // ERROR EXIT
	}

   wxPort::SetBaudRate(baudrate); //BM must persist here...

   // a quick check wether the COM is available at all
   termios mode;
   ::memset(&mode, 0, sizeof(mode));
   if (::tcgetattr(m_SerialPort_Handle, &mode) != 0) {
      m_lastError = IPAC_CommSetupFailed; return m_lastError; // ERROR EXIT
   }

   // just translate into UX Baudrate
   switch (baudrate) {
      case EBR_1200:
         ::cfsetispeed(&mode, B1200);
         ::cfsetospeed(&mode, B1200);
         break;
      case EBR_2400:
         ::cfsetispeed(&mode, B2400);
         ::cfsetospeed(&mode, B2400);
         break;
      case EBR_4800:
         ::cfsetispeed(&mode, B4800);
         ::cfsetospeed(&mode, B4800);
         break;
      case EBR_9600:
         ::cfsetispeed(&mode, B9600);
         ::cfsetospeed(&mode, B9600);
         break;
      case EBR_19200:
         ::cfsetispeed(&mode, B19200);
         ::cfsetospeed(&mode, B19200);
         break;
      case EBR_38400:
         ::cfsetispeed(&mode, B38400);
         ::cfsetospeed(&mode, B38400);
         break;

      case EBR_LAST:
      default:
      m_lastError = IPAC_CommSetupFailed; return m_lastError; // ERROR EXIT
   }// switch

   // now set the mode
   ::tcflush(m_SerialPort_Handle, TCIOFLUSH);
   if (::tcsetattr(m_SerialPort_Handle, TCSANOW, &mode) == 0) {
      ; //OK
   }
   else {
      m_lastError = IPAC_CommSetupFailed;
   }
   return m_lastError;
}
Exemplo n.º 16
0
	void KeyboardInputDevice::OnReleased(InputDeviceKey key)
	{
		Released(key);
	}
Exemplo n.º 17
0
void GuiButton::Update(GuiTrigger * t)
{
	if(state == STATE_DISABLED || !t || (this->IsAnimated() && (this->GetEffect() != EFFECT_PULSE)))
		return;
	else if(parentElement && ((parentElement->GetState() == STATE_DISABLED) || parentElement->IsAnimated()))
		return;

	#ifdef HW_RVL
	// cursor
	if(t->wpad->ir.valid && t->chan >= 0)
	{
		if(this->IsInside(t->wpad->ir.x, t->wpad->ir.y))
		{
			if(state == STATE_DEFAULT || (state == STATE_SELECTED && t->chan != stateChan)) // we weren't on the button before!
			{
				this->SetState(STATE_SELECTED, t->chan);

				if(this->Rumble())
					RequestRumble(t->chan);

				if(soundOver)
					soundOver->Play();

				if(tooltip)
					SelectTimer.reset();

				if(effectsOver && !effects)
				{
					// initiate effects
					effects = effectsOver;
					effectAmount = effectAmountOver;
					effectTarget = effectTargetOver;
				}
			}
		}
		else
		{
			if(state == STATE_SELECTED && (stateChan == t->chan || stateChan == -1))
				this->ResetState();

			if(effectTarget == effectTargetOver && effectAmount == effectAmountOver)
			{
				// initiate effects (in reverse)
				effects = effectsOver;
				effectAmount = -effectAmountOver;
				effectTarget = 100;
			}
		}
	}
	#endif

	// button triggers
	if(clickable)
	{
		u32 wm_btns = t->wpad->btns_d;

		for(int i = 0; i < 6; i++)
		{
			if(trigger[i] && (trigger[i]->chan == -1 || trigger[i]->chan == t->chan))
			{
				if((wm_btns & trigger[i]->wpad->btns_d) || (t->pad.btns_d & trigger[i]->pad.btns_d))
				{
					if(state == STATE_SELECTED)
					{
						if(!t->wpad->ir.valid || this->IsInside(t->wpad->ir.x, t->wpad->ir.y))
						{
							if(soundClick)
								soundClick->Play();
							
							POINT p = {0, 0};
							if (userInput[t->chan].wpad && userInput[t->chan].wpad->ir.valid)
							{
								p.x = userInput[t->chan].wpad->ir.x;
								p.y = userInput[t->chan].wpad->ir.y;
							}
							Clicked(this, t->chan, p);
							ClickAndHold = true;
							return;
						}
					}
					else if(trigger[i]->type == TRIGGER_BUTTON_ONLY)
					{
						POINT p = {0, 0};
						if (userInput[t->chan].wpad)
						{
							if (userInput[t->chan].wpad->ir.valid)
							{
								p.x = userInput[t->chan].wpad->ir.x;
								p.y = userInput[t->chan].wpad->ir.y;
							}
						}
						Clicked(this, t->chan, p);
						return;
					}
				}
			}
		}
	}

	if(holdable)
	{
		bool held = false;

		for(int i = 0; i < 6; i++)
		{
			//! if already found a trigger that takes effect stop searching
			if(held || !trigger[i])
				continue;

			if((t->wpad->btns_h & trigger[i]->wpad->btns_h) || (t->pad.btns_h & trigger[i]->pad.btns_h))
			{
				//! TRIGGER_BUTTON_ONLY_HELD is executed on every chan
				if(trigger[i]->type == TRIGGER_BUTTON_ONLY_HELD)
				{
					held = true;
					if(state != STATE_HELD)
						this->SetState(STATE_HELD, t->chan);
				}

				//! TRIGGER_HELD is executed only if holding the button
				else if(   (trigger[i]->type == TRIGGER_HELD)
						&& (   (trigger[i]->chan == -1)
							|| (trigger[i]->chan == t->chan)))
				{
					held = ClickAndHold;
					if(held && (state != STATE_HELD) && (state == STATE_SELECTED))
						this->SetState(STATE_HELD, t->chan);
				}
			}
		}

		if(held && (state == STATE_HELD) && (stateChan == t->chan))
		{
			POINT p = {0, 0};
			if (userInput[t->chan].wpad && userInput[t->chan].wpad->ir.valid)
			{
				p.x = userInput[t->chan].wpad->ir.x;
				p.y = userInput[t->chan].wpad->ir.y;
			}
			Held(this, t->chan, p);
			return;
		}
		else if(!held && (state == STATE_HELD) && (stateChan == t->chan))
		{
			POINT p = {0, 0};
			if (userInput[t->chan].wpad && userInput[t->chan].wpad->ir.valid)
			{
				p.x = userInput[t->chan].wpad->ir.x;
				p.y = userInput[t->chan].wpad->ir.y;
			}
			this->ResetState();
			Released(this, t->chan, p);
			ClickAndHold = false;
			return;
		}
	}
}