Skip to content

Commit bc47495

Browse files
authored
Merge pull request #2 from umjammer/0.0.3
0.0.3
2 parents 99dbbd0 + 6b9af37 commit bc47495

7 files changed

Lines changed: 32 additions & 32 deletions

File tree

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>vavi</groupId>
77
<artifactId>vavi-apps-hub</artifactId>
8-
<version>0.0.2</version>
8+
<version>0.0.3</version>
99

1010
<properties>
1111
<javapackager.name>Hub</javapackager.name>
@@ -170,13 +170,13 @@
170170
<dependency>
171171
<groupId>com.github.umjammer</groupId>
172172
<artifactId>vavi-commons</artifactId>
173-
<version>1.1.11</version>
173+
<version>1.1.12</version>
174174
</dependency>
175175

176176
<dependency>
177177
<groupId>com.github.umjammer</groupId> <!-- vavi / com.github.umjammer -->
178178
<artifactId>vavi-awt-joystick</artifactId>
179-
<version>0.0.8</version>
179+
<version>0.0.10</version>
180180
</dependency>
181181

182182
<dependency>
@@ -234,7 +234,7 @@
234234
<dependency>
235235
<groupId>com.formdev</groupId>
236236
<artifactId>flatlaf</artifactId>
237-
<version>3.3</version>
237+
<version>3.4.1</version>
238238
<scope>runtime</scope>
239239
</dependency>
240240

src/main/java/vavi/apps/hub/Gamepad.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77
package vavi.apps.hub;
88

9-
import java.io.IOException;
109
import java.util.logging.Level;
1110

11+
import net.java.games.input.ControllerEnvironment;
1212
import net.java.games.input.usb.HidController;
13-
import vavi.games.input.hid4java.spi.Hid4JavaEnvironmentPlugin;
13+
import net.java.games.input.usb.HidControllerEnvironment;
1414
import vavi.games.input.listener.GamepadInputEventListener;
1515
import vavi.util.Debug;
1616
import vavi.util.properties.annotation.Property;
@@ -49,7 +49,8 @@ public void init(Context context) {
4949
vendorId = Integer.decode(mid);
5050
productId = Integer.decode(pid);
5151

52-
Hid4JavaEnvironmentPlugin environment = new Hid4JavaEnvironmentPlugin();
52+
String name = "vavi.games.input.hid4java";
53+
HidControllerEnvironment environment = (HidControllerEnvironment) ControllerEnvironment.getEnvironmentByName(name);
5354
HidController controller = environment.getController(vendorId, productId);
5455
Debug.println(Level.INFO, controller);
5556

@@ -58,7 +59,8 @@ public void init(Context context) {
5859
controller.addInputEventListener(listener);
5960

6061
controller.open();
61-
} catch (IOException e) {
62+
} catch (Exception e) {
63+
Debug.printStackTrace(e);
6264
throw new IllegalStateException(e);
6365
}
6466
}

src/main/java/vavi/apps/hub/ws/JsonCodec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
public class JsonCodec {
3030

31-
private static Gson gson = new GsonBuilder().addSerializationExclusionStrategy(new ExclusionStrategy() {
31+
private static final Gson gson = new GsonBuilder().addSerializationExclusionStrategy(new ExclusionStrategy() {
3232
@Override
3333
public boolean shouldSkipField(FieldAttributes f) {
3434
return false;

src/main/java/vavi/games/input/listener/MinecraftListener.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -150,26 +150,26 @@ class RobotMouseKey extends Key {
150150
}
151151
}
152152

153-
Key key_D = new RobotKey(kVK_ANSI_D);
154-
Key key_A = new RobotKey(kVK_ANSI_A);
155-
Key key_S = new RobotKey(kVK_ANSI_S);
156-
Key key_W = new RobotKey(kVK_ANSI_W);
157-
Key key_F = new RobotKey(kVK_ANSI_F);
158-
Key key_F8 = new RobotKey(kVK_F8);
159-
Key key_0 = new RobotKey(kVK_ANSI_0);
160-
Key key_SPACE = new RobotKey(kVK_Space);
161-
Key key_2 = new RobotKey(kVK_ANSI_2);
162-
Key key_5 = new RobotKey(kVK_ANSI_5);
163-
Key mouseKey_0 = new RobotMouseKey(kCGMouseButtonLeft);
164-
Key mouseKey_1 = new RobotMouseKey(kCGMouseButtonRight);
165-
Key key_CONTROL = new RobotKey2(kVK_Control);
166-
Key key_SHIFT = new RobotKey2(kVK_Shift);
167-
Key key_ESCAPE = new RobotKey(kVK_Escape);
168-
Key key_Q = new RobotKey(kVK_ANSI_Q);
169-
Key key_OPTION = new RobotKey2(kVK_Option);
170-
Key key_F5 = new RobotKey(kVK_F5);
171-
Key key_F3 = new RobotKey(kVK_F3);
172-
Key key_E = new RobotKey(kVK_ANSI_E);
153+
final Key key_D = new RobotKey(kVK_ANSI_D);
154+
final Key key_A = new RobotKey(kVK_ANSI_A);
155+
final Key key_S = new RobotKey(kVK_ANSI_S);
156+
final Key key_W = new RobotKey(kVK_ANSI_W);
157+
final Key key_F = new RobotKey(kVK_ANSI_F);
158+
final Key key_F8 = new RobotKey(kVK_F8);
159+
final Key key_0 = new RobotKey(kVK_ANSI_0);
160+
final Key key_SPACE = new RobotKey(kVK_Space);
161+
final Key key_2 = new RobotKey(kVK_ANSI_2);
162+
final Key key_5 = new RobotKey(kVK_ANSI_5);
163+
final Key mouseKey_0 = new RobotMouseKey(kCGMouseButtonLeft);
164+
final Key mouseKey_1 = new RobotMouseKey(kCGMouseButtonRight);
165+
final Key key_CONTROL = new RobotKey2(kVK_Control);
166+
final Key key_SHIFT = new RobotKey2(kVK_Shift);
167+
final Key key_ESCAPE = new RobotKey(kVK_Escape);
168+
final Key key_Q = new RobotKey(kVK_ANSI_Q);
169+
final Key key_OPTION = new RobotKey2(kVK_Option);
170+
final Key key_F5 = new RobotKey(kVK_F5);
171+
final Key key_F3 = new RobotKey(kVK_F3);
172+
final Key key_E = new RobotKey(kVK_ANSI_E);
173173

174174
private Context context;
175175

src/main/java/vavi/games/input/listener/MuseScoreListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*/
2727
public class MuseScoreListener extends GamepadAdapter {
2828

29-
RococaRobot robot = new RococaRobot();
29+
final RococaRobot robot = new RococaRobot();
3030

3131
long prev = System.currentTimeMillis();
3232

src/test/java/TestJavaSystemTray.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* Programmed by Naohide Sano
55
*/
66

7-
import java.awt.AWTException;
87
import java.awt.Image;
98
import java.awt.MenuItem;
109
import java.awt.PopupMenu;

src/test/java/TestTwoSlices.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import com.sshtools.twoslices.Toast;
88
import com.sshtools.twoslices.ToastType;
9-
import com.sshtools.twoslices.ToasterSettings;
109

1110

1211
/**

0 commit comments

Comments
 (0)