-
Notifications
You must be signed in to change notification settings - Fork 67
Fixed touch on android #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| switch(flags){ | ||
| case AMOTION_EVENT_ACTION_POINTER_UP: | ||
| case AMOTION_EVENT_ACTION_UP:{ | ||
| touch_is_down[pid] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the value of pid to make sure it doesn't overflow the array of touch_is_down
CNFGEGLDriver.c
Outdated
| HandleButton( x, y, id, 0 ); | ||
| case AMOTION_EVENT_ACTION_POINTER_DOWN: | ||
| case AMOTION_EVENT_ACTION_DOWN:{ | ||
| touch_is_down[id] = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check to make sure you don't overflow the array.
CNFGEGLDriver.c
Outdated
| HandleMotion( x, y, index ); | ||
| case AMOTION_EVENT_ACTION_MOVE:{ | ||
| int off = 0; //number of touches preceeding i that are not down | ||
| for(int i = 0; i-off < pointer_count && pid+i<10; i++){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a #define for the number of touches.
|
like this? |
| size_t pointerCount = AMotionEvent_getPointerCount(event); | ||
| int pointer_count = AMotionEvent_getPointerCount(event); | ||
| int32_t action = AMotionEvent_getAction(event); | ||
| int flags = action & AMOTION_EVENT_ACTION_MASK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be still my heart! Even better!
|
Yes, this looks great. Thank you for the work! |
No description provided.