Skip to content

Commit

Permalink
Merge pull request #11 from umjammer/0.14.10v
Browse files Browse the repository at this point in the history
0.14.10v
  • Loading branch information
umjammer committed Apr 2, 2024
2 parents 30c70e1 + b1f346a commit aee9980
Show file tree
Hide file tree
Showing 31 changed files with 607 additions and 901 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* ~~spi attach/detach controller~~
* gyro
* https://github.com/keijiro/GyroInputTest
* reduce classes. compare with purejavahidpai, there are too many classes
* ~~reduce classes. compare with purejavahidpai, there are too many classes~~
* deadzone

---
Expand Down Expand Up @@ -73,20 +73,20 @@ provides more details.

```java
// Configure to use custom specification
HidServicesSpecification hidServicesSpecification = new HidServicesSpecification();
HidServicesSpecification hidSpecification = new HidServicesSpecification();

// Use the v0.7.0 manual start feature to get immediate attach events
hidServicesSpecification.setAutoStart(false);
hidSpecification.setAutoStart(false);

// Get HID services using custom specification
HidServices hidServices = HidManager.getHidServices(hidServicesSpecification);
hidServices.addHidServicesListener(this);
HidServices hidDevices = HidManager.getHidServices(hidSpecification);
hidDevices.addHidServicesListener(this);

// Manually start the services to get attachment event
hidServices.start();
hidDevices.start();

// Provide a list of attached devices
for (HidDevice hidDevice : hidServices.getAttachedHidDevices()) {
for (HidDevice hidDevice : hidDevices.getAttachedHidDevices()) {
System.out.println(hidDevice);
}

Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.hid4java</groupId>
<artifactId>hid4java</artifactId>
<version>0.14.9v</version>
<version>0.14.10v</version>

<name>hid4java</name>
<description>A cross-platform hidapi like library (depends on jna but hidapi native library)</description>
Expand Down Expand Up @@ -36,7 +36,7 @@

<properties>
<jinput.groupId>com.github.umjammer.jinput</jinput.groupId> <!-- net.java.jinput / com.github.umjammer.jinput -->
<jinput.version>2.0.18v</jinput.version>
<jinput.version>2.0.19v</jinput.version>
</properties>

<profiles>
Expand Down Expand Up @@ -200,7 +200,7 @@
<dependency>
<groupId>com.github.umjammer</groupId>
<artifactId>vavi-commons</artifactId>
<version>1.1.11</version>
<version>1.1.12</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/hid4java/HidDevice.java
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ public void close() throws IOException {
/**
* Sets input report listener.
*/
public void addInputReportListener(InputReportListener l) {
public void addInputReportListener(HidDeviceListener l) {
nativeDevice.addInputReportListener(l);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@


/**
* InputReportEvent.
* HidDeviceEvent.
*
* @author <a href="mailto:[email protected]">Naohide Sano</a> (nsano)
* @version 0.00 2023-10-08 nsano initial version <br>
*/
public class InputReportEvent extends EventObject {
public class HidDeviceEvent extends EventObject {

/** the report id number if used or zero */
private final int reportId;
Expand All @@ -25,7 +25,7 @@ public class InputReportEvent extends EventObject {
private final int length;

/** @param report a report data that contains first report id */
public InputReportEvent(Object source, int reportId, byte[] report, int length) {
public HidDeviceEvent(Object source, int reportId, byte[] report, int length) {
super(source);
this.reportId = reportId;
this.report = report;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


/**
* An InputReportListener gets called from background thread attached to a {@link HidDevice}
* An HidDeviceListener gets called from background thread attached to a {@link HidDevice}
* every time an input report is received from the tha associated USB device.
* <p>
* This is the only means of receiving input reports.
Expand All @@ -41,7 +41,7 @@
* @author nyholku
* @see "https://github.com/nyholku/purejavahidapi/blob/f769fcddf62503cff554e646587c92350ca664e5/src/purejavahidapi/InputReportListener.java"
*/
public interface InputReportListener {
public interface HidDeviceListener {

/**
* This method gets called when an input report is received.
Expand All @@ -53,5 +53,5 @@ public interface InputReportListener {
* keep a reference to it, instead process the data as quickly
* as possible and inside this call.
*/
void onInputReport(InputReportEvent event);
void onInputReport(HidDeviceEvent event);
}
Loading

0 comments on commit aee9980

Please sign in to comment.