[OSX] Change filtering behavior, GUI fix

Opening a mouse turns it off for whatever reason. This can be hard to
deal with on a mouse-based OS like OSX.
This commit is contained in:
Ash 2017-04-13 13:33:09 +10:00
parent 61c7cb31a2
commit 29fe7917a0
2 changed files with 4 additions and 3 deletions

View File

@ -87,7 +87,7 @@ public final class GuiInputControls extends JPanel {
}); });
ipTextBox = new JTextField(); ipTextBox = new JTextField();
ipTextBox.setColumns(15); ipTextBox.setColumns(14);
ipTextBox.setText(Settings.getIpAddr()); ipTextBox.setText(Settings.getIpAddr());
JPanel ipTextBoxWrap = new JPanel(new FlowLayout()); JPanel ipTextBoxWrap = new JPanel(new FlowLayout());
ipTextBoxWrap.add(new JLabel("IP: ")); ipTextBoxWrap.add(new JLabel("IP: "));

View File

@ -67,6 +67,7 @@ public final class Settings {
} }
File configFile = getConfigFile(); File configFile = getConfigFile();
if (!configFile.exists()) { if (!configFile.exists()) {
ControllerFiltering.setDefaultFilterStates();
log.info("Creating " + configFile.getAbsolutePath() + " with default values..."); log.info("Creating " + configFile.getAbsolutePath() + " with default values...");
try { try {
configFile.createNewFile(); configFile.createNewFile();
@ -209,7 +210,7 @@ public final class Settings {
public static enum Type { public static enum Type {
HIDGAMEPAD (0, "HID Gamepads", Platform.LINUX.mask | Platform.WINDOWS.mask | Platform.MAC_OS_X.mask), HIDGAMEPAD (0, "HID Gamepads", Platform.LINUX.mask | Platform.WINDOWS.mask | Platform.MAC_OS_X.mask),
HIDKEYBOARD (1, "HID Keyboards", Platform.LINUX.mask | Platform.MAC_OS_X.mask), HIDKEYBOARD (1, "HID Keyboards", Platform.LINUX.mask | Platform.MAC_OS_X.mask),
HIDMOUSE (2, "HID Mice", Platform.LINUX.mask | Platform.MAC_OS_X.mask), HIDMOUSE (2, "HID Mice", Platform.LINUX.mask),
HIDOTHER (3, "Other HIDs", Platform.LINUX.mask | Platform.WINDOWS.mask | Platform.MAC_OS_X.mask), HIDOTHER (3, "Other HIDs", Platform.LINUX.mask | Platform.WINDOWS.mask | Platform.MAC_OS_X.mask),
LINUX (4, "Linux controllers", Platform.LINUX.mask), LINUX (4, "Linux controllers", Platform.LINUX.mask),
XINPUT (5, "XInput controllers", Platform.WINDOWS.mask); XINPUT (5, "XInput controllers", Platform.WINDOWS.mask);
@ -246,7 +247,7 @@ public final class Settings {
filterStates[filter.index] = state; filterStates[filter.index] = state;
} }
public static boolean getFilterState(Type filter) { public static boolean getFilterState(Type filter) {
return filterStates[filter.index] || !filter.isSupportedOnPlatform(); return filterStates[filter.index];
} }
public static void setDefaultFilterStates() { public static void setDefaultFilterStates() {
filterStates[Type.HIDGAMEPAD.index] = true; filterStates[Type.HIDGAMEPAD.index] = true;