Multitouch fix
This commit is contained in:
@@ -19,8 +19,11 @@ namespace lime {
|
|||||||
|
|
||||||
void Flip ();
|
void Flip ();
|
||||||
void GetMouse ();
|
void GetMouse ();
|
||||||
|
bool getMultitouchSupported ();
|
||||||
|
bool getMultitouchActive ();
|
||||||
void Resize (const int inWidth, const int inHeight);
|
void Resize (const int inWidth, const int inHeight);
|
||||||
void SetCursor (Cursor inCursor);
|
void SetCursor (Cursor inCursor);
|
||||||
|
void setMultitouchActive (bool inActive);
|
||||||
|
|
||||||
Surface *GetPrimarySurface () { return mPrimarySurface; }
|
Surface *GetPrimarySurface () { return mPrimarySurface; }
|
||||||
bool isOpenGL () const { return true; }
|
bool isOpenGL () const { return true; }
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ namespace lime {
|
|||||||
|
|
||||||
|
|
||||||
int gFixedOrientation = -1;
|
int gFixedOrientation = -1;
|
||||||
|
int mSingleTouchID;
|
||||||
FrameCreationCallback sgCallback;
|
FrameCreationCallback sgCallback;
|
||||||
unsigned int sgFlags;
|
unsigned int sgFlags;
|
||||||
int sgHeight;
|
int sgHeight;
|
||||||
@@ -15,6 +16,8 @@ namespace lime {
|
|||||||
TizenFrame *sgTizenFrame;
|
TizenFrame *sgTizenFrame;
|
||||||
int sgWidth;
|
int sgWidth;
|
||||||
|
|
||||||
|
enum { NO_TOUCH = -1 };
|
||||||
|
|
||||||
|
|
||||||
void CreateMainFrame (FrameCreationCallback inOnFrame, int inWidth, int inHeight, unsigned int inFlags, const char *inTitle, Surface *inIcon) {
|
void CreateMainFrame (FrameCreationCallback inOnFrame, int inWidth, int inHeight, unsigned int inFlags, const char *inTitle, Surface *inIcon) {
|
||||||
|
|
||||||
@@ -24,6 +27,8 @@ namespace lime {
|
|||||||
sgFlags = inFlags;
|
sgFlags = inFlags;
|
||||||
sgTitle = inTitle;
|
sgTitle = inTitle;
|
||||||
|
|
||||||
|
mSingleTouchID = NO_TOUCH;
|
||||||
|
|
||||||
//if (sgWidth == 0 && sgHeight == 0) {
|
//if (sgWidth == 0 && sgHeight == 0) {
|
||||||
|
|
||||||
// Hard-code screen size for now
|
// Hard-code screen size for now
|
||||||
@@ -233,9 +238,14 @@ namespace lime {
|
|||||||
|
|
||||||
void TizenApplication::OnTouchMoved (const Tizen::Ui::Control &source, const Tizen::Graphics::Point ¤tPosition, const Tizen::Ui::TouchEventInfo &touchInfo) {
|
void TizenApplication::OnTouchMoved (const Tizen::Ui::Control &source, const Tizen::Graphics::Point ¤tPosition, const Tizen::Ui::TouchEventInfo &touchInfo) {
|
||||||
|
|
||||||
Event mouse (etMouseMove, currentPosition.x, currentPosition.y);
|
Event mouse (etTouchMove, currentPosition.x, currentPosition.y);
|
||||||
mouse.value = touchInfo.GetPointId ();
|
mouse.value = touchInfo.GetPointId ();
|
||||||
mouse.flags |= efLeftDown;
|
|
||||||
|
if (mSingleTouchID == NO_TOUCH || mouse.value == mSingleTouchID) {
|
||||||
|
|
||||||
|
mouse.flags |= efPrimaryTouch;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
sgTizenFrame->HandleEvent (mouse);
|
sgTizenFrame->HandleEvent (mouse);
|
||||||
|
|
||||||
@@ -244,9 +254,14 @@ namespace lime {
|
|||||||
|
|
||||||
void TizenApplication::OnTouchPressed (const Tizen::Ui::Control &source, const Tizen::Graphics::Point ¤tPosition, const Tizen::Ui::TouchEventInfo &touchInfo) {
|
void TizenApplication::OnTouchPressed (const Tizen::Ui::Control &source, const Tizen::Graphics::Point ¤tPosition, const Tizen::Ui::TouchEventInfo &touchInfo) {
|
||||||
|
|
||||||
Event mouse (etMouseDown, currentPosition.x, currentPosition.y);
|
Event mouse (etTouchBegin, currentPosition.x, currentPosition.y);
|
||||||
mouse.value = touchInfo.GetPointId ();
|
mouse.value = touchInfo.GetPointId ();
|
||||||
mouse.flags |= efLeftDown;
|
|
||||||
|
if (mSingleTouchID == NO_TOUCH || mouse.value == mSingleTouchID) {
|
||||||
|
|
||||||
|
mouse.flags |= efPrimaryTouch;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
sgTizenFrame->HandleEvent (mouse);
|
sgTizenFrame->HandleEvent (mouse);
|
||||||
|
|
||||||
@@ -255,9 +270,20 @@ namespace lime {
|
|||||||
|
|
||||||
void TizenApplication::OnTouchReleased (const Tizen::Ui::Control &source, const Tizen::Graphics::Point ¤tPosition, const Tizen::Ui::TouchEventInfo &touchInfo) {
|
void TizenApplication::OnTouchReleased (const Tizen::Ui::Control &source, const Tizen::Graphics::Point ¤tPosition, const Tizen::Ui::TouchEventInfo &touchInfo) {
|
||||||
|
|
||||||
Event mouse (etMouseUp, currentPosition.x, currentPosition.y);
|
Event mouse (etTouchEnd, currentPosition.x, currentPosition.y);
|
||||||
mouse.value = touchInfo.GetPointId ();
|
mouse.value = touchInfo.GetPointId ();
|
||||||
mouse.flags |= efLeftDown;
|
|
||||||
|
if (mSingleTouchID == NO_TOUCH || mouse.value == mSingleTouchID) {
|
||||||
|
|
||||||
|
mouse.flags |= efPrimaryTouch;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mSingleTouchID == mouse.value) {
|
||||||
|
|
||||||
|
mSingleTouchID = NO_TOUCH;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
sgTizenFrame->HandleEvent (mouse);
|
sgTizenFrame->HandleEvent (mouse);
|
||||||
|
|
||||||
|
|||||||
@@ -64,6 +64,20 @@ namespace lime {
|
|||||||
void TizenStage::GetMouse () {}
|
void TizenStage::GetMouse () {}
|
||||||
|
|
||||||
|
|
||||||
|
bool TizenStage::getMultitouchSupported () {
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool TizenStage::getMultitouchActive () {
|
||||||
|
|
||||||
|
//return mMultiTouch;
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void TizenStage::Resize (const int inWidth, const int inHeight) {
|
void TizenStage::Resize (const int inWidth, const int inHeight) {
|
||||||
|
|
||||||
AppLog ("Resize: %d x %d\n", inWidth, inHeight);
|
AppLog ("Resize: %d x %d\n", inWidth, inHeight);
|
||||||
@@ -109,6 +123,13 @@ namespace lime {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TizenStage::setMultitouchActive (bool inActive) {
|
||||||
|
|
||||||
|
//mMultiTouch = inActive;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*#define TIZEN_TRANS(x) case TIZEN_KEY_##x: return key##x;
|
/*#define TIZEN_TRANS(x) case TIZEN_KEY_##x: return key##x;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user