Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (512)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Latest Jinput  (Read 4370 times)
0 Members and 1 Guest are viewing this topic.
Offline Andrew Davison

Junior Duke


Medals: 2



« Posted 2005-11-25 05:44:48 »

The JInput versions at https://games-binaries.dev.java.net/build/index.html are misleadingly dated. They're actually from May 2004. Ignore the 2005 extension.

The windows download contains two copies of the 4 API files, and dxinput.jar and dxinput.dll need to be stored in a controller/ subdirectory in order for things to work.

But actually, none of that matters. The most current versions of JInput are at
http://www.newdawnsoftware.com/resources/jinput/, with the Windows version dating from September 2005. It's been simplified to two files, but the only documentation on how to use it appears in http://www.java-gaming.org/forums/index.php?topic=10634.0, near the bottom of p.1 in a post by endolf.

None of the JInput documentation mentions this, including the freefodder tutorial https://freefodder.dev.java.net/tutorial/jinputTutorialOne.html.

Come on guys, spend 20 minutes and fix things up Smiley

- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline Andrew Davison

Junior Duke


Medals: 2



« Reply #1 - Posted 2005-11-27 03:59:18 »

I'm replying to myself again Smiley

I tried installing jinput_windows_2005-09-01.zip from http://www.newdawnsoftware.com/resources/jinput/, and the Axis class is missing! That seems just a tad sloppy to my mind.

There's eight other versions of the Windows version of the JInput at the site, but I think I'll stick with the working version from https://games-binaries.dev.java.net/build/index.html. BTW, the Version.getVersion() method for that version reports 1.0.0-b01.

- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline kevglass

JGO Kernel


Medals: 186
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #2 - Posted 2005-11-27 11:14:02 »

Endolf is away at the moment - and since this "community" project is basically just him most of the time - I can't see it being fixed in "20 minutes".

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #3 - Posted 2005-11-27 17:01:40 »

Axis got renamed to Component some time ago, looks like you have old examples or javadocs. There are javadocs that should be up to date in the files section under core at the jinput project page.

HTH

Endolf

Offline Andrew Davison

Junior Duke


Medals: 2



« Reply #4 - Posted 2005-11-28 02:44:22 »

The only documentation at https://games-binaries.dev.java.net/build/index.html that I could find was in the nightly builds section, and uses Axis.

However, I did find current documentation at http://www.newdawnsoftware.com/resources/jinput/ in jinput_coreapi_javadoc.zip.

Perhaps, I've missed something, but was this change to one of the major class names announced anywhere? This will break most applications that upgrade their version of JInput.

Anyway, I changed Axis --> Component, and "axes" to "components", and the freefodder examples and mine work again on my test Windows 98 and XP machines.

What is the 'official' version of JInput that users should download?
Should people wishing to use JInput go to http://jinput.dev.java.net or to http://www.newdawnsoftware.com/resources/jinput/?

- Andrew


Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline Andrew Davison

Junior Duke


Medals: 2



« Reply #5 - Posted 2005-11-28 05:15:13 »

For the sake of other people upgrading their version of JInput.

Aside from Axis --> Component, the way that component (axis) identifiers are named has also changed. The ID names are now divided into Component.Identifier.Axis,
Component.Identifier.Button, and Component.Identifier.Key. They were previously all in Axis.Identifier. The new identifier classes have more names.

Previously, the buttons on my game pad were labelled as "button" but they are now  "Unknown" in the Component.Identifier.Button class.

- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #6 - Posted 2005-11-29 12:31:52 »

Hi

It was announced and discussed on this board here and here.

The 'Offical' place to get things is from jinput.dev.java.net. Some of the things there are links to the newdawn sites copy, but thats just because thats where I uploaded them too, not because it's the right source. I often upload to the newdawn site and then test it from there so I can check I got all the files right etc, and then update the webstart and test it. Then I create a new link on the jinput project page at jinput.dev.java.net. Until it's in jinput.dev.java.net it's not a proper release.

There used to be a build system somewhere at sun that did nightly jinput builds, those were the closest thing to official releases. For some reason it stopped doing any builds and we now have a 'solution' where by when I change something, I do a build and let other people access it by placing a link on jinput.dev.java.net, this is not an official release as such, it's just the latest one I've done. Unfortunatly, at the moment, thats the closest we have.

As for the Unknown button stuff on windows, it's an issue left over from when the change was made, I need to look at it, but I've been away on honeymoon for 10 days and just got back. I know why it does it, i've not got a solution yet though. It is on my list of todos.

Endolf

Offline Jeff

JGO Coder




Got any cats?


« Reply #7 - Posted 2005-11-29 21:13:38 »


There used to be a build system somewhere at sun that did nightly jinput builds, those were the closest thing to official releases. For some reason it stopped doing any builds

FUnding for the lab that did that and the person resonpsible was cut.


Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Andrew Davison

Junior Duke


Medals: 2



« Reply #8 - Posted 2005-11-30 04:38:27 »

I can't find any links at https://jinput.dev.java.net/ to http://www.newdawnsoftware.com/resources/jinput/; where are they?

How is a newbie JInput programmer (i.e. me Smiley) meant to find the posts about the class name changes?

I fixed the "Unknown" problem by getting the identifier's class name and extracting the last part. So Component.Identifier.Axis, Component.Identifier.Button, and Component.Identifier.Key return "axis", "button", and "key". Here's a code fragment:
1  
2  
3  
4  
5  
6  
   String fullClassName = cmp.getIdentifier().getClass().getName();
    int index = fullClassName.indexOf("Identifier$");
    if (index == -1)    // the class name isn't useful
      return "Unknown";
    else
      return fullClassName.substring( index+11 ).toLowerCase();  // skip "Identifier$"


- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline chrisw1229

Senior Newbie





« Reply #9 - Posted 2005-11-30 07:21:29 »

I fixed the "Unknown" problem by getting the identifier's class name and extracting the last part. So Component.Identifier.Axis, Component.Identifier.Button, and Component.Identifier.Key return "axis", "button", and "key". Here's a code fragment:

I'm not sure what your use case is, but I would think that does not solve the real problem for the majority of users.  For example, if I am creating a game I want to say "button0 means jump", "button1 means punch", or something similar.  If your extracted identifier for each button only returns "button" then there is still no reliable way to distinguish between them all and therefore you don't know what action the user actually wants.

Chris
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #10 - Posted 2005-11-30 07:42:31 »


Don't look for links Smiley

From the front page there, on the left hand menu, select documents and files, then select a platform to get the binaries for.

As for the Identifier stuff, I agree with chrisw1229, the identifier is supposed to be a type id so you can get the type of the button. I've done some investigation on this and will hopefully be fixing it this week.

Endolf

Offline Andrew Davison

Junior Duke


Medals: 2



« Reply #11 - Posted 2005-11-30 08:46:06 »

Thanks for the directions to the latest files. It's clear then that user's wanting a 'stable' version of JInput should go the "Documents and Files" menu item at https://jinput.dev.java.net/.

As regards the identifier, I'm using it to distinguish buttons from the axes on my game pad. In that case, "button" is more informative than "Unknown".

- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #12 - Posted 2005-11-30 12:26:34 »

As regards the identifier, I'm using it to distinguish buttons from the axes on my game pad. In that case, "button" is more informative than "Unknown".

But it's the same thing because it's not Unknown, it's Component.Identifier.Button.Unknown, which specifies that it's an unknown button.

For your needs you should be able to do something like

String thingName = cmp.getIdentifier().toString();
if(cmp.getIdentifier() == Component.Identifier.Button.Unknown) {
  thingyName = "Unknown Button";
}

This should be more efficient that getting the class name and searching for the index.

From the changes to the ID's, the identifiers returned from getIdentifier() should be the static ones in the components interface.

HTH

Endolf

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (50 views)
2014-10-17 03:59:02

Norakomi (39 views)
2014-10-16 15:22:06

Norakomi (31 views)
2014-10-16 15:20:20

lcass (35 views)
2014-10-15 16:18:58

TehJavaDev (66 views)
2014-10-14 00:39:48

TehJavaDev (65 views)
2014-10-14 00:35:47

TehJavaDev (55 views)
2014-10-14 00:32:37

BurntPizza (72 views)
2014-10-11 23:24:42

BurntPizza (43 views)
2014-10-11 23:10:45

BurntPizza (84 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!