Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
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  
  JInput Chapter Online  (Read 4551 times)
0 Members and 1 Guest are viewing this topic.
Offline Andrew Davison

Junior Devvie


Medals: 2



« Posted 2005-12-06 07:47:05 »

Dear All,

I've added a chapter on programming with JInput to the Killer Game Programming in Java web site at http://fivedots.coe.psu.ac.th/~ad/jg/.

It's chapter 28.9 near the bottom of the page.

Comments are appreciated.

- 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 #1 - Posted 2005-12-06 12:54:59 »

Hi

It's always goot to see people using JInput, and some documentation is always welcomed. Mind if I link to the PDF from the jinput.dev.java.net site and the forums? Smiley

On page 6 you mention that all buttons are assigned the ID of "UNKNOWN", there is a new build, that means they are assigned a number, or if possible the right ID (only works for a few so far). My gamepad has 11 buttons that directx admits to, a,b,c, x,y,z, R1, R2, L1, L2 and start. a,b,c and x,y,z now come up with the identifier A, B, C, X, Y, Z as they do under linux. The others don't, but come up with an ID of _<number> where number is the order in which they were detected. This is a first attempt at getting some platform independance when it comes to button IDs (Axis are alot easier for some reason).

On page 8 you mention that jinput uses directx8, this is correct, I'm not sure if it's me, but the wording almost suggests that something is broken for this to be the case. If thats your opinion then thats OK, everyone is entitled to one Smiley, just wanted to see if that is what you meant, or if the wording is just not quite clear.

On page 8 you mention the Version number, thats a JInput issue, I'll sort something out about that, your the only person I know who's spotted that one, good find Smiley

On page 9 you mention about the port type. I'm not 100%, but I think that information is hidden by direct x so there is no way for jinput to know, so unknown is correct. I'll take a more thorough look at some point to confirm this though.

On page 14/15 you say don't display 0.0 values because it means it's not been manipulated, but thats only the case for relative devices, for absolute devices a value of 0.0 could mean that it has been moved from one extreme or some other location, to the centre. Checking it's not the same as the last value when it becomes 0.0 would cerfice for absolute controls, for relative controls you are right, hide 0.0 values. (I just went through the same thing for my input code Smiley). It's just a point thats worth making at some point in the text, it would slightly complicate the method though, and you might not want that in the simple examples. It's your article after all Smiley

On page 30 you mention the webstart version on the newdawnsoftware site. The version you reference should have been deleted (my fault), the new one, and the one that does get updated (although it's a demo, not a repository, so it gets updated when I feel like it rather than at each release) can be found at http://www.newdawnsoftware.com/resources/jinput/webstart/jinput2.jnlp.

It's an excelent document and I hope my comments are constructive. Nothing is intended to offend.

If you need more info, just holler.

Endolf

Offline Andrew Davison

Junior Devvie


Medals: 2



« Reply #2 - Posted 2005-12-07 02:30:27 »

Endolf,

Thanks for the constructive comments. I've revised the chapter to address all your points.

When a new 'official' version of JInput is put up at https://jinput.dev.java.net/, I'd be happy to rerun my examples, and update the chapter again.

Of course you can link to the article. Could you please link to the Web page (http://fivedots.coe.psu.ac.th/~ad/jg/ch289/), rather than just the PDF, and then readers will see the examples zip file and the Portfolio loader.

- Andrew

Dr. Andrew Davison
Dept. of Computer Engineering
Prince of Songkla University, Hat Yai
Songkhla 90112, Thailand
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline chrisw1229

Senior Newbie





« Reply #3 - Posted 2005-12-07 04:40:42 »

Great article Andrew, there is a lot of good information there.  You bring up a few issues I noticed myself, so I thought I would discuss them while we're at it...

@Endolf

1.) Andrew mentioned that his gamepad is detected as a joystick and so are mine, I was wondering what jinput/directx uses as its definition for a gamepad?  Is it something reported by the hardware itself or is it the fact that many modern gamepads now include analog sticks that resemble the functionality we used to only find in joysticks?

2.) If directx does in fact prevent you from identifying the port type, would another possible solution be to find that out from the operating system API since you know other information like the device name?

Neither points are a big deal, I was just curious.

Chris
Offline croft

Junior Devvie




Java, Java, Java


« Reply #4 - Posted 2006-01-16 05:19:04 »

On page 30 you mention the webstart version on the newdawnsoftware site. The version you reference should have been deleted (my fault), the new one, and the one that does get updated (although it's a demo, not a repository, so it gets updated when I feel like it rather than at each release) can be found at http://www.newdawnsoftware.com/resources/jinput/webstart/jinput2.jnlp.

Thanks for the example JNLP file, Endolf.  I used it to get my pacifier input device working with Java Web Start on Windows.  Check out the movie I made:
http://www.croftsoft.com/library/software/infant/

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #5 - Posted 2006-01-16 12:35:04 »

Hi

Glad someone has found it useful. That was the point Smiley

Endolf

Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #6 - Posted 2006-01-16 15:52:47 »

... pacifier input device ....  Check out the movie I made:
http://www.croftsoft.com/library/software/infant/

Looking at that input device gives me the shivers.  Can you say "strangulation risk" ?

http://www.dcu.org/streetwise/kids/toy.html

"Cords, string, ribbons, and rope can pose strangulation hazards. These can easily become wrapped around a child's neck."

Offline croft

Junior Devvie




Java, Java, Java


« Reply #7 - Posted 2006-01-18 00:55:55 »

Looking at that input device gives me the shivers.  Can you say "strangulation risk" ?

I should reassure you that this is for use in scientific research only.  I do not believe that the infant will be unattended.

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
Offline swpalmer

JGO Coder


Exp: 12 years


Where's the Kaboom?


« Reply #8 - Posted 2006-01-19 04:09:06 »

Ah!  Interesting!

Offline croft

Junior Devvie




Java, Java, Java


« Reply #9 - Posted 2006-01-30 04:02:38 »

Ah!  Interesting!

I added a strangulation warning to my webpage describing the device in case anyone reading it should build and use it on their own:
http://www.croftsoft.com/library/software/infant/

Thank you for your comment.

David Wallace Croft / www.CroftSoft.com / (214) 636-3790 m / Advanced Java Game Programming
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.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (113 views)
2014-11-26 15:22:04

toopeicgaming1999 (100 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!