mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2026-04-21 06:14:11 +00:00
Added cleanup stuff for rumblers, it doesn't fix the code, but is nice
This commit is contained in:
parent
d4c72ba15c
commit
04e3538e83
11 changed files with 85 additions and 42 deletions
|
|
@ -8,6 +8,12 @@ public class LinuxDeviceRumbler implements Rumbler {
|
|||
|
||||
public LinuxDeviceRumbler(int deviceID) {
|
||||
this.deviceID = deviceID;
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||
public void run() {
|
||||
cleanup();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void rumble(float intensity) {
|
||||
|
|
@ -25,5 +31,12 @@ public class LinuxDeviceRumbler implements Rumbler {
|
|||
return null;
|
||||
}
|
||||
|
||||
private void cleanup() {
|
||||
nativeCleanup(deviceID);
|
||||
}
|
||||
|
||||
private native void nativeRumble(int deviceID, float intensity);
|
||||
|
||||
private native void nativeCleanup(int deviceID);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue