Skip to content

Commit

Permalink
Merge pull request #2 from umjammer/0.0.3
Browse files Browse the repository at this point in the history
0.0.3
  • Loading branch information
umjammer authored Apr 2, 2024
2 parents 99dbbd0 + 6b9af37 commit bc47495
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>vavi</groupId>
<artifactId>vavi-apps-hub</artifactId>
<version>0.0.2</version>
<version>0.0.3</version>

<properties>
<javapackager.name>Hub</javapackager.name>
Expand Down Expand Up @@ -170,13 +170,13 @@
<dependency>
<groupId>com.github.umjammer</groupId>
<artifactId>vavi-commons</artifactId>
<version>1.1.11</version>
<version>1.1.12</version>
</dependency>

<dependency>
<groupId>com.github.umjammer</groupId> <!-- vavi / com.github.umjammer -->
<artifactId>vavi-awt-joystick</artifactId>
<version>0.0.8</version>
<version>0.0.10</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -234,7 +234,7 @@
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>3.3</version>
<version>3.4.1</version>
<scope>runtime</scope>
</dependency>

Expand Down
10 changes: 6 additions & 4 deletions src/main/java/vavi/apps/hub/Gamepad.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

package vavi.apps.hub;

import java.io.IOException;
import java.util.logging.Level;

import net.java.games.input.ControllerEnvironment;
import net.java.games.input.usb.HidController;
import vavi.games.input.hid4java.spi.Hid4JavaEnvironmentPlugin;
import net.java.games.input.usb.HidControllerEnvironment;
import vavi.games.input.listener.GamepadInputEventListener;
import vavi.util.Debug;
import vavi.util.properties.annotation.Property;
Expand Down Expand Up @@ -49,7 +49,8 @@ public void init(Context context) {
vendorId = Integer.decode(mid);
productId = Integer.decode(pid);

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

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

controller.open();
} catch (IOException e) {
} catch (Exception e) {
Debug.printStackTrace(e);
throw new IllegalStateException(e);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/vavi/apps/hub/ws/JsonCodec.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public class JsonCodec {

private static Gson gson = new GsonBuilder().addSerializationExclusionStrategy(new ExclusionStrategy() {
private static final Gson gson = new GsonBuilder().addSerializationExclusionStrategy(new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes f) {
return false;
Expand Down
40 changes: 20 additions & 20 deletions src/main/java/vavi/games/input/listener/MinecraftListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,26 +150,26 @@ class RobotMouseKey extends Key {
}
}

Key key_D = new RobotKey(kVK_ANSI_D);
Key key_A = new RobotKey(kVK_ANSI_A);
Key key_S = new RobotKey(kVK_ANSI_S);
Key key_W = new RobotKey(kVK_ANSI_W);
Key key_F = new RobotKey(kVK_ANSI_F);
Key key_F8 = new RobotKey(kVK_F8);
Key key_0 = new RobotKey(kVK_ANSI_0);
Key key_SPACE = new RobotKey(kVK_Space);
Key key_2 = new RobotKey(kVK_ANSI_2);
Key key_5 = new RobotKey(kVK_ANSI_5);
Key mouseKey_0 = new RobotMouseKey(kCGMouseButtonLeft);
Key mouseKey_1 = new RobotMouseKey(kCGMouseButtonRight);
Key key_CONTROL = new RobotKey2(kVK_Control);
Key key_SHIFT = new RobotKey2(kVK_Shift);
Key key_ESCAPE = new RobotKey(kVK_Escape);
Key key_Q = new RobotKey(kVK_ANSI_Q);
Key key_OPTION = new RobotKey2(kVK_Option);
Key key_F5 = new RobotKey(kVK_F5);
Key key_F3 = new RobotKey(kVK_F3);
Key key_E = new RobotKey(kVK_ANSI_E);
final Key key_D = new RobotKey(kVK_ANSI_D);
final Key key_A = new RobotKey(kVK_ANSI_A);
final Key key_S = new RobotKey(kVK_ANSI_S);
final Key key_W = new RobotKey(kVK_ANSI_W);
final Key key_F = new RobotKey(kVK_ANSI_F);
final Key key_F8 = new RobotKey(kVK_F8);
final Key key_0 = new RobotKey(kVK_ANSI_0);
final Key key_SPACE = new RobotKey(kVK_Space);
final Key key_2 = new RobotKey(kVK_ANSI_2);
final Key key_5 = new RobotKey(kVK_ANSI_5);
final Key mouseKey_0 = new RobotMouseKey(kCGMouseButtonLeft);
final Key mouseKey_1 = new RobotMouseKey(kCGMouseButtonRight);
final Key key_CONTROL = new RobotKey2(kVK_Control);
final Key key_SHIFT = new RobotKey2(kVK_Shift);
final Key key_ESCAPE = new RobotKey(kVK_Escape);
final Key key_Q = new RobotKey(kVK_ANSI_Q);
final Key key_OPTION = new RobotKey2(kVK_Option);
final Key key_F5 = new RobotKey(kVK_F5);
final Key key_F3 = new RobotKey(kVK_F3);
final Key key_E = new RobotKey(kVK_ANSI_E);

private Context context;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public class MuseScoreListener extends GamepadAdapter {

RococaRobot robot = new RococaRobot();
final RococaRobot robot = new RococaRobot();

long prev = System.currentTimeMillis();

Expand Down
1 change: 0 additions & 1 deletion src/test/java/TestJavaSystemTray.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* Programmed by Naohide Sano
*/

import java.awt.AWTException;
import java.awt.Image;
import java.awt.MenuItem;
import java.awt.PopupMenu;
Expand Down
1 change: 0 additions & 1 deletion src/test/java/TestTwoSlices.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.sshtools.twoslices.Toast;
import com.sshtools.twoslices.ToastType;
import com.sshtools.twoslices.ToasterSettings;


/**
Expand Down

0 comments on commit bc47495

Please sign in to comment.