aboutsummaryrefslogtreecommitdiffstats
path: root/coreAPI/src/java
diff options
context:
space:
mode:
authorendolf <[email protected]>2003-12-01 23:41:20 +0000
committerendolf <[email protected]>2003-12-01 23:41:20 +0000
commit03facfd36fc0cbdb901880a8f2561726acb32336 (patch)
tree5f0b953e2103e8cd87892f0170f9d94cf0b82fb3 /coreAPI/src/java
parent0f30b506759df12a092ca647bcaac94985ec2fe4 (diff)
Initial rumbler test support
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@62 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'coreAPI/src/java')
-rw-r--r--coreAPI/src/java/net/java/games/input/test/RumbleTest.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/coreAPI/src/java/net/java/games/input/test/RumbleTest.java b/coreAPI/src/java/net/java/games/input/test/RumbleTest.java
new file mode 100644
index 0000000..706485b
--- /dev/null
+++ b/coreAPI/src/java/net/java/games/input/test/RumbleTest.java
@@ -0,0 +1,56 @@
+/*
+ * RumbleTest.java
+ *
+ * Created on 01 December 2003, 23:02
+ */
+package net.java.games.input.test;
+
+import net.java.games.input.ControllerEnvironment;
+import net.java.games.input.Controller;
+import net.java.games.input.Rumbler;
+
+/**
+ *
+ * @author Jeremy
+ */
+public class RumbleTest {
+
+ /** Creates a new instance of RumbleTest */
+ public RumbleTest() {
+ ControllerEnvironment ca = ControllerEnvironment.getDefaultEnvironment();
+ Controller[] controllers = ca.getControllers();
+ for(int i=0;i<controllers.length;i++) {
+ System.out.println("Scanning " + controllers[i].getName());
+ Rumbler[] rumblers = controllers[i].getRumblers();
+ System.out.println("Found " + rumblers.length + " rumblers");
+ for(int j=0;j<rumblers.length;j++) {
+ System.out.println("Rumbling with intensity: " + 0.5f);
+ rumblers[j].rumble(0.5f);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ System.out.println("Rumbling with intensity: " + 1.0f);
+ rumblers[j].rumble(1f);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ System.out.println("Rumbling with intensity: " + 0.0f);
+ rumblers[j].rumble(0f);
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+ }
+
+ /**
+ * @param args the command line arguments
+ */
+ public static void main(String[] args) {
+ new RumbleTest();
+ }
+
+}