Android: Native motion controls
This commit is contained in:
parent
6d193d3b5a
commit
b143df91be
|
@ -4,6 +4,12 @@
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.touchscreen"
|
android:name="android.hardware.touchscreen"
|
||||||
android:required="false"/>
|
android:required="false"/>
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.sensor.accelerometer"
|
||||||
|
android:required="false"/>
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.sensor.gyroscope"
|
||||||
|
android:required="false"/>
|
||||||
<uses-feature
|
<uses-feature
|
||||||
android:name="android.hardware.gamepad"
|
android:name="android.hardware.gamepad"
|
||||||
android:required="false"/>
|
android:required="false"/>
|
||||||
|
|
|
@ -135,6 +135,18 @@ Turntable/Stick/Radius = 100,000000
|
||||||
Turntable/Effect/Dial = `Axis 621`
|
Turntable/Effect/Dial = `Axis 621`
|
||||||
Turntable/Crossfade/Left = `Axis 623`
|
Turntable/Crossfade/Left = `Axis 623`
|
||||||
Turntable/Crossfade/Right = `Axis 624`
|
Turntable/Crossfade/Right = `Axis 624`
|
||||||
|
IMUAccelerometer/Left = `Axis 625`
|
||||||
|
IMUAccelerometer/Right = `Axis 626`
|
||||||
|
IMUAccelerometer/Forward = `Axis 627`
|
||||||
|
IMUAccelerometer/Backward = `Axis 628`
|
||||||
|
IMUAccelerometer/Up = `Axis 629`
|
||||||
|
IMUAccelerometer/Down = `Axis 630`
|
||||||
|
IMUGyroscope/Pitch Up = `Axis 631`
|
||||||
|
IMUGyroscope/Pitch Down = `Axis 632`
|
||||||
|
IMUGyroscope/Roll Left = `Axis 633`
|
||||||
|
IMUGyroscope/Roll Right = `Axis 634`
|
||||||
|
IMUGyroscope/Yaw Left = `Axis 635`
|
||||||
|
IMUGyroscope/Yaw Right = `Axis 636`
|
||||||
Source = 1
|
Source = 1
|
||||||
Rumble/Motor = `Rumble 700`
|
Rumble/Motor = `Rumble 700`
|
||||||
[Wiimote2]
|
[Wiimote2]
|
||||||
|
@ -274,6 +286,18 @@ Turntable/Stick/Radius = 100,000000
|
||||||
Turntable/Effect/Dial = `Axis 621`
|
Turntable/Effect/Dial = `Axis 621`
|
||||||
Turntable/Crossfade/Left = `Axis 623`
|
Turntable/Crossfade/Left = `Axis 623`
|
||||||
Turntable/Crossfade/Right = `Axis 624`
|
Turntable/Crossfade/Right = `Axis 624`
|
||||||
|
IMUAccelerometer/Left = `Axis 625`
|
||||||
|
IMUAccelerometer/Right = `Axis 626`
|
||||||
|
IMUAccelerometer/Forward = `Axis 627`
|
||||||
|
IMUAccelerometer/Backward = `Axis 628`
|
||||||
|
IMUAccelerometer/Up = `Axis 629`
|
||||||
|
IMUAccelerometer/Down = `Axis 630`
|
||||||
|
IMUGyroscope/Pitch Up = `Axis 631`
|
||||||
|
IMUGyroscope/Pitch Down = `Axis 632`
|
||||||
|
IMUGyroscope/Roll Left = `Axis 633`
|
||||||
|
IMUGyroscope/Roll Right = `Axis 634`
|
||||||
|
IMUGyroscope/Yaw Left = `Axis 635`
|
||||||
|
IMUGyroscope/Yaw Right = `Axis 636`
|
||||||
Source = 0
|
Source = 0
|
||||||
Rumble/Motor = `Rumble 700`
|
Rumble/Motor = `Rumble 700`
|
||||||
[Wiimote3]
|
[Wiimote3]
|
||||||
|
@ -413,6 +437,18 @@ Turntable/Stick/Radius = 100,000000
|
||||||
Turntable/Effect/Dial = `Axis 621`
|
Turntable/Effect/Dial = `Axis 621`
|
||||||
Turntable/Crossfade/Left = `Axis 623`
|
Turntable/Crossfade/Left = `Axis 623`
|
||||||
Turntable/Crossfade/Right = `Axis 624`
|
Turntable/Crossfade/Right = `Axis 624`
|
||||||
|
IMUAccelerometer/Left = `Axis 625`
|
||||||
|
IMUAccelerometer/Right = `Axis 626`
|
||||||
|
IMUAccelerometer/Forward = `Axis 627`
|
||||||
|
IMUAccelerometer/Backward = `Axis 628`
|
||||||
|
IMUAccelerometer/Up = `Axis 629`
|
||||||
|
IMUAccelerometer/Down = `Axis 630`
|
||||||
|
IMUGyroscope/Pitch Up = `Axis 631`
|
||||||
|
IMUGyroscope/Pitch Down = `Axis 632`
|
||||||
|
IMUGyroscope/Roll Left = `Axis 633`
|
||||||
|
IMUGyroscope/Roll Right = `Axis 634`
|
||||||
|
IMUGyroscope/Yaw Left = `Axis 635`
|
||||||
|
IMUGyroscope/Yaw Right = `Axis 636`
|
||||||
Source = 0
|
Source = 0
|
||||||
Rumble/Motor = `Rumble 700`
|
Rumble/Motor = `Rumble 700`
|
||||||
[Wiimote4]
|
[Wiimote4]
|
||||||
|
@ -552,5 +588,17 @@ Turntable/Stick/Radius = 100,000000
|
||||||
Turntable/Effect/Dial = `Axis 621`
|
Turntable/Effect/Dial = `Axis 621`
|
||||||
Turntable/Crossfade/Left = `Axis 623`
|
Turntable/Crossfade/Left = `Axis 623`
|
||||||
Turntable/Crossfade/Right = `Axis 624`
|
Turntable/Crossfade/Right = `Axis 624`
|
||||||
|
IMUAccelerometer/Left = `Axis 625`
|
||||||
|
IMUAccelerometer/Right = `Axis 626`
|
||||||
|
IMUAccelerometer/Forward = `Axis 627`
|
||||||
|
IMUAccelerometer/Backward = `Axis 628`
|
||||||
|
IMUAccelerometer/Up = `Axis 629`
|
||||||
|
IMUAccelerometer/Down = `Axis 630`
|
||||||
|
IMUGyroscope/Pitch Up = `Axis 631`
|
||||||
|
IMUGyroscope/Pitch Down = `Axis 632`
|
||||||
|
IMUGyroscope/Roll Left = `Axis 633`
|
||||||
|
IMUGyroscope/Roll Right = `Axis 634`
|
||||||
|
IMUGyroscope/Yaw Left = `Axis 635`
|
||||||
|
IMUGyroscope/Yaw Right = `Axis 636`
|
||||||
Source = 0
|
Source = 0
|
||||||
Rumble/Motor = `Rumble 700`
|
Rumble/Motor = `Rumble 700`
|
||||||
|
|
|
@ -135,4 +135,16 @@ Turntable/Stick/Radius = 100,000000
|
||||||
Turntable/Effect/Dial = `Axis 621`
|
Turntable/Effect/Dial = `Axis 621`
|
||||||
Turntable/Crossfade/Left = `Axis 623`
|
Turntable/Crossfade/Left = `Axis 623`
|
||||||
Turntable/Crossfade/Right = `Axis 624`
|
Turntable/Crossfade/Right = `Axis 624`
|
||||||
|
IMUAccelerometer/Left = `Axis 625`
|
||||||
|
IMUAccelerometer/Right = `Axis 626`
|
||||||
|
IMUAccelerometer/Forward = `Axis 627`
|
||||||
|
IMUAccelerometer/Backward = `Axis 628`
|
||||||
|
IMUAccelerometer/Up = `Axis 629`
|
||||||
|
IMUAccelerometer/Down = `Axis 630`
|
||||||
|
IMUGyroscope/Pitch Up = `Axis 631`
|
||||||
|
IMUGyroscope/Pitch Down = `Axis 632`
|
||||||
|
IMUGyroscope/Roll Left = `Axis 633`
|
||||||
|
IMUGyroscope/Roll Right = `Axis 634`
|
||||||
|
IMUGyroscope/Yaw Left = `Axis 635`
|
||||||
|
IMUGyroscope/Yaw Right = `Axis 636`
|
||||||
Rumble/Motor = `Rumble 700`
|
Rumble/Motor = `Rumble 700`
|
||||||
|
|
|
@ -195,6 +195,18 @@ public final class NativeLibrary
|
||||||
public static final int TURNTABLE_CROSSFADE = 622;
|
public static final int TURNTABLE_CROSSFADE = 622;
|
||||||
public static final int TURNTABLE_CROSSFADE_LEFT = 623;
|
public static final int TURNTABLE_CROSSFADE_LEFT = 623;
|
||||||
public static final int TURNTABLE_CROSSFADE_RIGHT = 624;
|
public static final int TURNTABLE_CROSSFADE_RIGHT = 624;
|
||||||
|
public static final int WIIMOTE_ACCEL_LEFT = 625;
|
||||||
|
public static final int WIIMOTE_ACCEL_RIGHT = 626;
|
||||||
|
public static final int WIIMOTE_ACCEL_FORWARD = 627;
|
||||||
|
public static final int WIIMOTE_ACCEL_BACKWARD = 628;
|
||||||
|
public static final int WIIMOTE_ACCEL_UP = 629;
|
||||||
|
public static final int WIIMOTE_ACCEL_DOWN = 630;
|
||||||
|
public static final int WIIMOTE_GYRO_PITCH_UP = 631;
|
||||||
|
public static final int WIIMOTE_GYRO_PITCH_DOWN = 632;
|
||||||
|
public static final int WIIMOTE_GYRO_ROLL_LEFT = 633;
|
||||||
|
public static final int WIIMOTE_GYRO_ROLL_RIGHT = 634;
|
||||||
|
public static final int WIIMOTE_GYRO_YAW_LEFT = 635;
|
||||||
|
public static final int WIIMOTE_GYRO_YAW_RIGHT = 636;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -48,6 +48,7 @@ import org.dolphinemu.dolphinemu.utils.ControllerMappingHelper;
|
||||||
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
|
import org.dolphinemu.dolphinemu.utils.FileBrowserHelper;
|
||||||
import org.dolphinemu.dolphinemu.utils.Java_GCAdapter;
|
import org.dolphinemu.dolphinemu.utils.Java_GCAdapter;
|
||||||
import org.dolphinemu.dolphinemu.utils.Java_WiimoteAdapter;
|
import org.dolphinemu.dolphinemu.utils.Java_WiimoteAdapter;
|
||||||
|
import org.dolphinemu.dolphinemu.utils.MotionListener;
|
||||||
import org.dolphinemu.dolphinemu.utils.Rumble;
|
import org.dolphinemu.dolphinemu.utils.Rumble;
|
||||||
import org.dolphinemu.dolphinemu.utils.TvUtil;
|
import org.dolphinemu.dolphinemu.utils.TvUtil;
|
||||||
|
|
||||||
|
@ -66,6 +67,7 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
private EmulationFragment mEmulationFragment;
|
private EmulationFragment mEmulationFragment;
|
||||||
|
|
||||||
private SharedPreferences mPreferences;
|
private SharedPreferences mPreferences;
|
||||||
|
private MotionListener mMotionListener;
|
||||||
private ControllerMappingHelper mControllerMappingHelper;
|
private ControllerMappingHelper mControllerMappingHelper;
|
||||||
|
|
||||||
private Settings mSettings;
|
private Settings mSettings;
|
||||||
|
@ -258,6 +260,7 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
// first launch emulation and then ask the core which console we're emulating
|
// first launch emulation and then ask the core which console we're emulating
|
||||||
sIsGameCubeGame = Platform.fromNativeInt(mPlatform) == Platform.GAMECUBE;
|
sIsGameCubeGame = Platform.fromNativeInt(mPlatform) == Platform.GAMECUBE;
|
||||||
mDeviceHasTouchScreen = getPackageManager().hasSystemFeature("android.hardware.touchscreen");
|
mDeviceHasTouchScreen = getPackageManager().hasSystemFeature("android.hardware.touchscreen");
|
||||||
|
mMotionListener = new MotionListener(this);
|
||||||
mControllerMappingHelper = new ControllerMappingHelper();
|
mControllerMappingHelper = new ControllerMappingHelper();
|
||||||
|
|
||||||
int themeId;
|
int themeId;
|
||||||
|
@ -347,6 +350,22 @@ public final class EmulationActivity extends AppCompatActivity
|
||||||
mPlatform = savedInstanceState.getInt(EXTRA_PLATFORM);
|
mPlatform = savedInstanceState.getInt(EXTRA_PLATFORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onResume()
|
||||||
|
{
|
||||||
|
super.onResume();
|
||||||
|
if (!sIsGameCubeGame)
|
||||||
|
mMotionListener.enable();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onPause()
|
||||||
|
{
|
||||||
|
super.onPause();
|
||||||
|
if (!sIsGameCubeGame)
|
||||||
|
mMotionListener.disable();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop()
|
protected void onStop()
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ public final class DirectoryInitialization
|
||||||
"org.dolphinemu.dolphinemu.DIRECTORY_INITIALIZATION";
|
"org.dolphinemu.dolphinemu.DIRECTORY_INITIALIZATION";
|
||||||
|
|
||||||
public static final String EXTRA_STATE = "directoryState";
|
public static final String EXTRA_STATE = "directoryState";
|
||||||
private static final Integer WiimoteNewVersion = 2;
|
private static final int WiimoteNewVersion = 3; // Last changed in PR 8439
|
||||||
private static volatile DirectoryInitializationState directoryState = null;
|
private static volatile DirectoryInitializationState directoryState = null;
|
||||||
private static String userPath;
|
private static String userPath;
|
||||||
private static String internalPath;
|
private static String internalPath;
|
||||||
|
|
|
@ -0,0 +1,88 @@
|
||||||
|
package org.dolphinemu.dolphinemu.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.hardware.Sensor;
|
||||||
|
import android.hardware.SensorEvent;
|
||||||
|
import android.hardware.SensorEventListener;
|
||||||
|
import android.hardware.SensorManager;
|
||||||
|
|
||||||
|
import org.dolphinemu.dolphinemu.NativeLibrary;
|
||||||
|
import org.dolphinemu.dolphinemu.NativeLibrary.ButtonType;
|
||||||
|
|
||||||
|
public class MotionListener implements SensorEventListener
|
||||||
|
{
|
||||||
|
private final SensorManager mSensorManager;
|
||||||
|
private final Sensor mAccelSensor;
|
||||||
|
private final Sensor mGyroSensor;
|
||||||
|
|
||||||
|
// The same sampling period as for Wii Remotes
|
||||||
|
private static final int SAMPLING_PERIOD_US = 1000000 / 200;
|
||||||
|
|
||||||
|
public MotionListener(Context context)
|
||||||
|
{
|
||||||
|
mSensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
|
||||||
|
mAccelSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
|
||||||
|
mGyroSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSensorChanged(SensorEvent sensorEvent)
|
||||||
|
{
|
||||||
|
if (sensorEvent.sensor == mAccelSensor)
|
||||||
|
{
|
||||||
|
float x = -sensorEvent.values[0];
|
||||||
|
float y = -sensorEvent.values[1];
|
||||||
|
float z = sensorEvent.values[2];
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_ACCEL_LEFT, x);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_ACCEL_RIGHT, x);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_ACCEL_FORWARD, y);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_ACCEL_BACKWARD, y);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_ACCEL_UP, z);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_ACCEL_DOWN, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sensorEvent.sensor == mGyroSensor)
|
||||||
|
{
|
||||||
|
float x = -sensorEvent.values[0];
|
||||||
|
float y = -sensorEvent.values[1];
|
||||||
|
float z = sensorEvent.values[2];
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_GYRO_PITCH_UP, x);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_GYRO_PITCH_DOWN, x);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_GYRO_ROLL_LEFT, y);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_GYRO_ROLL_RIGHT, y);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_GYRO_YAW_LEFT, z);
|
||||||
|
NativeLibrary.onGamePadMoveEvent(NativeLibrary.TouchScreenDevice,
|
||||||
|
ButtonType.WIIMOTE_GYRO_YAW_RIGHT, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onAccuracyChanged(Sensor sensor, int i)
|
||||||
|
{
|
||||||
|
// We don't care about this
|
||||||
|
}
|
||||||
|
|
||||||
|
public void enable()
|
||||||
|
{
|
||||||
|
if (mAccelSensor != null)
|
||||||
|
mSensorManager.registerListener(this, mAccelSensor, SAMPLING_PERIOD_US);
|
||||||
|
if (mGyroSensor != null)
|
||||||
|
mSensorManager.registerListener(this, mGyroSensor, SAMPLING_PERIOD_US);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disable()
|
||||||
|
{
|
||||||
|
mSensorManager.unregisterListener(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -18,7 +18,7 @@ namespace ButtonManager
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
constexpr char touchScreenKey[] = "Touchscreen";
|
constexpr char touchScreenKey[] = "Touchscreen";
|
||||||
constexpr std::array<const char*, 143> configStrings{{
|
constexpr std::array<const char*, 155> configStrings{{
|
||||||
// GC
|
// GC
|
||||||
"InputA",
|
"InputA",
|
||||||
"InputB",
|
"InputB",
|
||||||
|
@ -168,11 +168,24 @@ constexpr std::array<const char*, 143> configStrings{{
|
||||||
"TurntableEffDial",
|
"TurntableEffDial",
|
||||||
"TurntableCrossLeft",
|
"TurntableCrossLeft",
|
||||||
"TurntableCrossRight",
|
"TurntableCrossRight",
|
||||||
|
// Wiimote IMU
|
||||||
|
"WiimoteAccelLeft",
|
||||||
|
"WiimoteAccelRight",
|
||||||
|
"WiimoteAccelForward",
|
||||||
|
"WiimoteAccelBackward",
|
||||||
|
"WiimoteAccelUp",
|
||||||
|
"WiimoteAccelDown",
|
||||||
|
"WiimoteGyroPitchUp",
|
||||||
|
"WiimoteGyroPitchDown",
|
||||||
|
"WiimoteGyroRollLeft",
|
||||||
|
"WiimoteGyroRollRight",
|
||||||
|
"WiimoteGyroYawLeft",
|
||||||
|
"WiimoteGyroYawRight",
|
||||||
// Rumble
|
// Rumble
|
||||||
"Rumble",
|
"Rumble",
|
||||||
}};
|
}};
|
||||||
|
|
||||||
constexpr std::array<ButtonType, 143> configTypes{{
|
constexpr std::array<ButtonType, 155> configTypes{{
|
||||||
// GC
|
// GC
|
||||||
BUTTON_A,
|
BUTTON_A,
|
||||||
BUTTON_B,
|
BUTTON_B,
|
||||||
|
@ -322,6 +335,19 @@ constexpr std::array<ButtonType, 143> configTypes{{
|
||||||
TURNTABLE_EFFECT_DIAL,
|
TURNTABLE_EFFECT_DIAL,
|
||||||
TURNTABLE_CROSSFADE_LEFT,
|
TURNTABLE_CROSSFADE_LEFT,
|
||||||
TURNTABLE_CROSSFADE_RIGHT,
|
TURNTABLE_CROSSFADE_RIGHT,
|
||||||
|
// Wiimote IMU
|
||||||
|
WIIMOTE_ACCEL_LEFT,
|
||||||
|
WIIMOTE_ACCEL_RIGHT,
|
||||||
|
WIIMOTE_ACCEL_FORWARD,
|
||||||
|
WIIMOTE_ACCEL_BACKWARD,
|
||||||
|
WIIMOTE_ACCEL_UP,
|
||||||
|
WIIMOTE_ACCEL_DOWN,
|
||||||
|
WIIMOTE_GYRO_PITCH_UP,
|
||||||
|
WIIMOTE_GYRO_PITCH_DOWN,
|
||||||
|
WIIMOTE_GYRO_ROLL_LEFT,
|
||||||
|
WIIMOTE_GYRO_ROLL_RIGHT,
|
||||||
|
WIIMOTE_GYRO_YAW_LEFT,
|
||||||
|
WIIMOTE_GYRO_YAW_RIGHT,
|
||||||
// Rumble
|
// Rumble
|
||||||
RUMBLE,
|
RUMBLE,
|
||||||
}};
|
}};
|
||||||
|
@ -562,6 +588,29 @@ void Init(const std::string& gameId)
|
||||||
new sBind(a, TURNTABLE_CROSSFADE_LEFT, BIND_AXIS, TURNTABLE_CROSSFADE_LEFT, -1.0f));
|
new sBind(a, TURNTABLE_CROSSFADE_LEFT, BIND_AXIS, TURNTABLE_CROSSFADE_LEFT, -1.0f));
|
||||||
AddBind(touchScreenKey,
|
AddBind(touchScreenKey,
|
||||||
new sBind(a, TURNTABLE_CROSSFADE_RIGHT, BIND_AXIS, TURNTABLE_CROSSFADE_RIGHT, 1.0f));
|
new sBind(a, TURNTABLE_CROSSFADE_RIGHT, BIND_AXIS, TURNTABLE_CROSSFADE_RIGHT, 1.0f));
|
||||||
|
|
||||||
|
// Wiimote IMU
|
||||||
|
AddBind(touchScreenKey, new sBind(a, WIIMOTE_ACCEL_LEFT, BIND_AXIS, WIIMOTE_ACCEL_LEFT, 1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_ACCEL_RIGHT, BIND_AXIS, WIIMOTE_ACCEL_RIGHT, -1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_ACCEL_FORWARD, BIND_AXIS, WIIMOTE_ACCEL_FORWARD, -1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_ACCEL_BACKWARD, BIND_AXIS, WIIMOTE_ACCEL_BACKWARD, 1.0f));
|
||||||
|
AddBind(touchScreenKey, new sBind(a, WIIMOTE_ACCEL_UP, BIND_AXIS, WIIMOTE_ACCEL_UP, 1.0f));
|
||||||
|
AddBind(touchScreenKey, new sBind(a, WIIMOTE_ACCEL_DOWN, BIND_AXIS, WIIMOTE_ACCEL_DOWN, -1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_GYRO_PITCH_UP, BIND_AXIS, WIIMOTE_GYRO_PITCH_UP, -1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_GYRO_PITCH_DOWN, BIND_AXIS, WIIMOTE_GYRO_PITCH_DOWN, 1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_GYRO_ROLL_LEFT, BIND_AXIS, WIIMOTE_GYRO_ROLL_LEFT, 1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_GYRO_ROLL_RIGHT, BIND_AXIS, WIIMOTE_GYRO_ROLL_RIGHT, -1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_GYRO_YAW_LEFT, BIND_AXIS, WIIMOTE_GYRO_YAW_LEFT, 1.0f));
|
||||||
|
AddBind(touchScreenKey,
|
||||||
|
new sBind(a, WIIMOTE_GYRO_YAW_RIGHT, BIND_AXIS, WIIMOTE_GYRO_YAW_RIGHT, -1.0f));
|
||||||
}
|
}
|
||||||
// Init our controller bindings
|
// Init our controller bindings
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
|
|
|
@ -176,6 +176,19 @@ enum ButtonType
|
||||||
TURNTABLE_CROSSFADE = 622, // To Be Used on Java Side
|
TURNTABLE_CROSSFADE = 622, // To Be Used on Java Side
|
||||||
TURNTABLE_CROSSFADE_LEFT = 623,
|
TURNTABLE_CROSSFADE_LEFT = 623,
|
||||||
TURNTABLE_CROSSFADE_RIGHT = 624,
|
TURNTABLE_CROSSFADE_RIGHT = 624,
|
||||||
|
// Wiimote IMU
|
||||||
|
WIIMOTE_ACCEL_LEFT = 625,
|
||||||
|
WIIMOTE_ACCEL_RIGHT = 626,
|
||||||
|
WIIMOTE_ACCEL_FORWARD = 627,
|
||||||
|
WIIMOTE_ACCEL_BACKWARD = 628,
|
||||||
|
WIIMOTE_ACCEL_UP = 629,
|
||||||
|
WIIMOTE_ACCEL_DOWN = 630,
|
||||||
|
WIIMOTE_GYRO_PITCH_UP = 631,
|
||||||
|
WIIMOTE_GYRO_PITCH_DOWN = 632,
|
||||||
|
WIIMOTE_GYRO_ROLL_LEFT = 633,
|
||||||
|
WIIMOTE_GYRO_ROLL_RIGHT = 634,
|
||||||
|
WIIMOTE_GYRO_YAW_LEFT = 635,
|
||||||
|
WIIMOTE_GYRO_YAW_RIGHT = 636,
|
||||||
// Rumble
|
// Rumble
|
||||||
RUMBLE = 700,
|
RUMBLE = 700,
|
||||||
};
|
};
|
||||||
|
|
|
@ -185,6 +185,20 @@ Touchscreen::Touchscreen(int padID) : _padID(padID)
|
||||||
AddInput(new Axis(_padID, ButtonManager::TURNTABLE_CROSSFADE_RIGHT));
|
AddInput(new Axis(_padID, ButtonManager::TURNTABLE_CROSSFADE_RIGHT));
|
||||||
AddInput(new Axis(_padID, ButtonManager::TURNTABLE_EFFECT_DIAL));
|
AddInput(new Axis(_padID, ButtonManager::TURNTABLE_EFFECT_DIAL));
|
||||||
|
|
||||||
|
// Wiimote IMU
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_ACCEL_LEFT));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_ACCEL_RIGHT));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_ACCEL_FORWARD));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_ACCEL_BACKWARD));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_ACCEL_UP));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_ACCEL_DOWN));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_GYRO_PITCH_UP));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_GYRO_PITCH_DOWN));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_GYRO_ROLL_LEFT));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_GYRO_ROLL_RIGHT));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_GYRO_YAW_LEFT));
|
||||||
|
AddInput(new Axis(_padID, ButtonManager::WIIMOTE_GYRO_YAW_RIGHT));
|
||||||
|
|
||||||
// Rumble
|
// Rumble
|
||||||
AddOutput(new Motor(_padID, ButtonManager::RUMBLE));
|
AddOutput(new Motor(_padID, ButtonManager::RUMBLE));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue