Analog stick for scrolling in mouse emulation mode
This commit is contained in:
@@ -17,6 +17,12 @@ public class PreferenceConfiguration {
|
||||
FORCE_H264,
|
||||
};
|
||||
|
||||
public enum AnalogStickForScrolling {
|
||||
NONE,
|
||||
RIGHT,
|
||||
LEFT
|
||||
}
|
||||
|
||||
private static final String LEGACY_RES_FPS_PREF_STRING = "list_resolution_fps";
|
||||
private static final String LEGACY_ENABLE_51_SURROUND_PREF_STRING = "checkbox_51_surround";
|
||||
|
||||
@@ -44,6 +50,7 @@ public class PreferenceConfiguration {
|
||||
private static final String ENABLE_PERF_OVERLAY_STRING = "checkbox_enable_perf_overlay";
|
||||
private static final String BIND_ALL_USB_STRING = "checkbox_usb_bind_all";
|
||||
private static final String MOUSE_EMULATION_STRING = "checkbox_mouse_emulation";
|
||||
private static final String ANALOG_SCROLLING_PREF_STRING = "analog_scrolling";
|
||||
private static final String MOUSE_NAV_BUTTONS_STRING = "checkbox_mouse_nav_buttons";
|
||||
static final String UNLOCK_FPS_STRING = "checkbox_unlock_fps";
|
||||
private static final String VIBRATE_OSC_PREF_STRING = "checkbox_vibrate_osc";
|
||||
@@ -80,6 +87,7 @@ public class PreferenceConfiguration {
|
||||
private static final boolean DEFAULT_ENABLE_PERF_OVERLAY = false;
|
||||
private static final boolean DEFAULT_BIND_ALL_USB = false;
|
||||
private static final boolean DEFAULT_MOUSE_EMULATION = true;
|
||||
private static final String DEFAULT_ANALOG_STICK_FOR_SCROLLING = "right";
|
||||
private static final boolean DEFAULT_MOUSE_NAV_BUTTONS = false;
|
||||
private static final boolean DEFAULT_UNLOCK_FPS = false;
|
||||
private static final boolean DEFAULT_VIBRATE_OSC = true;
|
||||
@@ -126,6 +134,7 @@ public class PreferenceConfiguration {
|
||||
public boolean enableLatencyToast;
|
||||
public boolean bindAllUsb;
|
||||
public boolean mouseEmulation;
|
||||
public AnalogStickForScrolling analogStickForScrolling;
|
||||
public boolean mouseNavButtons;
|
||||
public boolean unlockFps;
|
||||
public boolean vibrateOsc;
|
||||
@@ -384,6 +393,21 @@ public class PreferenceConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
private static AnalogStickForScrolling getAnalogStickForScrollingValue(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
String str = prefs.getString(ANALOG_SCROLLING_PREF_STRING, DEFAULT_ANALOG_STICK_FOR_SCROLLING);
|
||||
if (str.equals("right")) {
|
||||
return AnalogStickForScrolling.RIGHT;
|
||||
}
|
||||
else if (str.equals("left")) {
|
||||
return AnalogStickForScrolling.LEFT;
|
||||
}
|
||||
else {
|
||||
return AnalogStickForScrolling.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
public static void resetStreamingSettings(Context context) {
|
||||
// We consider resolution, FPS, bitrate, HDR, and video format as "streaming settings" here
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
@@ -532,6 +556,8 @@ public class PreferenceConfiguration {
|
||||
config.videoFormat = getVideoFormatValue(context);
|
||||
config.framePacing = getFramePacingValue(context);
|
||||
|
||||
config.analogStickForScrolling = getAnalogStickForScrollingValue(context);
|
||||
|
||||
config.deadzonePercentage = prefs.getInt(DEADZONE_PREF_STRING, DEFAULT_DEADZONE);
|
||||
|
||||
config.oscOpacity = prefs.getInt(OSC_OPACITY_PREF_STRING, DEFAULT_OPACITY);
|
||||
|
||||
Reference in New Issue
Block a user