https://www.jpct.net/wiki/index.php?title=Applet_using_the_lwjgl_joystick&feed=atom&action=history
Applet using the lwjgl joystick - Revision history
2024-03-29T04:51:42Z
Revision history for this page on the wiki
MediaWiki 1.23.15
https://www.jpct.net/wiki/index.php?title=Applet_using_the_lwjgl_joystick&diff=414&oldid=prev
Admin at 22:35, 1 February 2013
2013-02-01T22:35:27Z
<p></p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Revision as of 22:35, 1 February 2013</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 23:</td>
<td colspan="2" class="diff-lineno">Line 23:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>}</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div></pre></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:jPCT]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:LWJGL]]</ins></div></td></tr>
</table>
Admin
https://www.jpct.net/wiki/index.php?title=Applet_using_the_lwjgl_joystick&diff=90&oldid=prev
AGP: Created page with 'In init(): <pre> Controllers controllers = new Controllers(); try { controllers.create(); if (controllers.getControllerCount() > 0) { joystick = controllers.getContr...'
2009-04-24T08:35:42Z
<p>Created page with 'In init(): <pre> Controllers controllers = new Controllers(); try { controllers.create(); if (controllers.getControllerCount() > 0) { joystick = controllers.getContr...'</p>
<p><b>New page</b></p><div>In init():<br />
<pre><br />
Controllers controllers = new Controllers();<br />
try {<br />
controllers.create();<br />
if (controllers.getControllerCount() > 0) {<br />
joystick = controllers.getController(0);<br />
System.out.println("Joystick has "+joystick.getButtonCount() +" buttons. Its name is "+joystick.getName());<br />
}<br />
else joystick = null;<br />
}<br />
catch (org.lwjgl.LWJGLException e) {System.err.println("Couldn't initialize Controllers: "+e.getMessage());}<br />
</pre><br />
In the main applet loop:<br />
<pre><br />
if (joystick != null) {<br />
joystick.poll();<br />
rotateZ += joystick.getXAxisValue()/2f;<br />
if (joystick.isButtonPressed(0))<br />
;//DO SOMETHING<br />
if (joystick.isButtonPressed(1))<br />
;//DO SOMETHING ELSE<br />
}<br />
</pre></div>
AGP