mirror of
https://github.com/Maschell/HIDtoVPADNetworkClient.git
synced 2024-11-22 05:59:16 +01:00
[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:
parent
61c7cb31a2
commit
29fe7917a0
@ -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: "));
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user