示例#1
0
void CCEGLView::setIMEKeyboardState(bool bOpen)
{
	if(bOpen && s3eOSReadStringAvailable() == S3E_TRUE) {
		const char* inputText = s3eOSReadStringUTF8("") ;
		if( inputText!=0 ) {
			CCIMEDispatcher::sharedDispatcher()->dispatchInsertText(inputText, strlen(inputText));
		}
	}
}
示例#2
0
bool CIwGameInput::Init()
{
	Tapped = false;
	Dragging = false;
	PreviousNumTouches = 0;
	BackPressed = false;
	MenuPressed = false;

	// Check to see if the device that we are running on supports the pointer
    PointerAvailable = s3ePointerGetInt(S3E_POINTER_AVAILABLE) ? true : false;

	if (PointerAvailable)
	{
		// Clear out the touches array
		for (int t = 0; t < MAX_TOUCHES; t++)
		{
			Touches[t].active = false;
			Touches[t].id = 0;
		}

		// Determine if the device supports multi-touch
		IsMultiTouch = s3ePointerGetInt(S3E_POINTER_MULTI_TOUCH_AVAILABLE) ? true : false;

		// For multi-touch devices we handle touch and motion events using different callbacks
		if (IsMultiTouch)
		{
			s3ePointerRegister(S3E_POINTER_TOUCH_EVENT, (s3eCallback)HandleMultiTouchButtonCB, NULL);
			s3ePointerRegister(S3E_POINTER_TOUCH_MOTION_EVENT, (s3eCallback)HandleMultiTouchMotionCB, NULL);
		}
		else
		{
			s3ePointerRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)HandleSingleTouchButtonCB, NULL);
			s3ePointerRegister(S3E_POINTER_MOTION_EVENT, (s3eCallback)HandleSingleTouchMotionCB, NULL);
		}
	}

	// Check to see if the device that we are running on supports the keyboard
    KeysAvailable = ((s3eKeyboardGetInt(S3E_KEYBOARD_HAS_KEYPAD) || s3eKeyboardGetInt(S3E_KEYBOARD_HAS_ALPHA))) ? true : false;

	// Check to see if the device that we are running on supports the on screen keyboard
	OSKeyboardAvailable = s3eOSReadStringAvailable() == S3E_TRUE; 

	// Check accelerometer availability
	if (s3eAccelerometerGetInt(S3E_ACCELEROMETER_AVAILABLE))
		AccelerometerAvailable = true;
	else
		AccelerometerAvailable = false;

	// Check compass availability
	if (s3eCompassAvailable())
		CompassAvailable = true;
	else
		CompassAvailable = false;

	return true; // Pointer support
}
示例#3
0
文件: input.cpp 项目: dblo/XTD
bool CInput::Init()
{
	// Check to see if the device that we are running on supports the pointer
    PointerAvailable = s3ePointerGetInt(S3E_POINTER_AVAILABLE) ? true : false;
	if (!PointerAvailable)
		return false;	// No pointer support

	if (PointerAvailable)
	{
		// Clear out the touches array
		for (int t = 0; t < MAX_TOUCHES; t++)
		{
			Touches[t].active = false;
			Touches[t].id = 0;
		}

		// Determine if the device supports multi-touch
		IsMultiTouch = s3ePointerGetInt(S3E_POINTER_MULTI_TOUCH_AVAILABLE) ? true : false;

		// For multi-touch devices we handle touch and motion events using different callbacks
		if (IsMultiTouch)
		{
			s3ePointerRegister(S3E_POINTER_TOUCH_EVENT, (s3eCallback)HandleMultiTouchButtonCB, NULL);
			s3ePointerRegister(S3E_POINTER_TOUCH_MOTION_EVENT, (s3eCallback)HandleMultiTouchMotionCB, NULL);
		}
		else
		{
			s3ePointerRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)HandleSingleTouchButtonCB, NULL);
			s3ePointerRegister(S3E_POINTER_MOTION_EVENT, (s3eCallback)HandleSingleTouchMotionCB, NULL);
		}
	}

	// Check to see if the device that we are running on supports the keyboard
    KeysAvailable = (s3eKeyboardGetInt(S3E_KEYBOARD_HAS_KEYPAD) || s3eKeyboardGetInt(S3E_KEYBOARD_HAS_ALPHA));

	// Check to see if the device that we are running on supports the on screen keyboard
	OSKeyboardAvailable = s3eOSReadStringAvailable() == S3E_TRUE; 

	return true; // Pointer support
}