mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
[Android] Change how the onTouchEvent native method works. Just pass in the correct Button ID and Action and it'll be pressed or not. Not actually rigged up to the Java code yet. Doesn't support anything with an Axis yet so no C stick, main stick, L and R triggers
This commit is contained in:
@ -17,12 +17,11 @@ public final class NativeLibrary
|
||||
{
|
||||
/**
|
||||
* Handles touch events.
|
||||
*
|
||||
*
|
||||
* @param Button Key code identifying which button was pressed.
|
||||
* @param Action Mask for the action being performed.
|
||||
* @param X Location on the screen's X-axis that the touch event occurred.
|
||||
* @param Y Location on the screen's Y-axis that the touch event occurred.
|
||||
*/
|
||||
public static native void onTouchEvent(int Action, float X, float Y);
|
||||
public static native void onTouchEvent(int Button, int Action);
|
||||
|
||||
/**
|
||||
* Handles button press events for a gamepad.
|
||||
|
@ -135,22 +135,6 @@ public final class EmulationActivity extends Activity
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent event)
|
||||
{
|
||||
float X = event.getX();
|
||||
float Y = event.getY();
|
||||
int Action = event.getActionMasked();
|
||||
|
||||
// Converts button locations 0 - 1 to OGL screen coords -1.0 - 1.0
|
||||
float ScreenX = ((X / screenWidth) * 2.0f) - 1.0f;
|
||||
float ScreenY = ((Y / screenHeight) * -2.0f) + 1.0f;
|
||||
|
||||
NativeLibrary.onTouchEvent(Action, ScreenX, ScreenY);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed()
|
||||
{
|
||||
|
Reference in New Issue
Block a user