key down / up and mouse android native
Posted: 19 Aug 2022, 05:07
I wanted to know how do I make noesis understand that I'm clicking on a button or hovering over the UI, my application is working perfectly on windows but on android apparently nothing involving touch or keyboard keys is working
i'm using android native c++, i found an example in the code and copied it to mine but it still doesn't work, i need to activate something specific to know i'm using android?
code part:
obs: the interface is rendering perfectly on android the positions are all just the same on windows i'm just having this problem with the touch and key
i'm using android native c++, i found an example in the code and copied it to mine but it still doesn't work, i need to activate something specific to know i'm using android?
code part:
Code: Select all
case AMOTION_EVENT_ACTION_DOWN:
case AMOTION_EVENT_ACTION_POINTER_DOWN:
{
int x = (int)AMotionEvent_getX(event, index);
int y = (int)AMotionEvent_getY(event, index);
NS_LOG_TRACE("MOTION_EVENT TouchDown %d;%d (%" PRIu64 ")", x, y, pointerId);
ui->GetView()->TouchDown(x, y, pointerId);
break;
}
case AMOTION_EVENT_ACTION_UP:
case AMOTION_EVENT_ACTION_POINTER_UP:
{
int x = (int)AMotionEvent_getX(event, index);
int y = (int)AMotionEvent_getY(event, index);
NS_LOG_TRACE("MOTION_EVENT TouchUp %d;%d (%" PRIu64 ")", x, y, pointerId);
ui->GetView()->TouchUp(x, y, pointerId);
break;
}
case AMOTION_EVENT_ACTION_MOVE:
{
int numPointers = AMotionEvent_getPointerCount(event);
for (index = 0; index < numPointers; ++index)
{
pointerId = (uint64_t)AMotionEvent_getPointerId(event, index);
int x = (int)AMotionEvent_getX(event, index);
int y = (int)AMotionEvent_getY(event, index);
NS_LOG_TRACE("MOTION_EVENT TouchMove %d;%d (%" PRIu64 ")", x, y, pointerId);
ui->GetView()->TouchMove(x, y, pointerId);
}
break;
}