Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
games submitted by our members
Games in WIP (500)
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  
  USB keyboard oddities  (Read 2252 times)
0 Members and 1 Guest are viewing this topic.
Offline 5parrowhawk

Senior Newbie




Java games rock!


« Posted 2004-06-04 20:03:20 »

Hi,

Have experienced strange results with a Memorex USB keyboard under DX9. I haven't installed the drivers for the additional silly buttons (never use them anyway).

I wrote up a little diagnostic prog to dump the name and type of all controllers to the console.

When I run it, my USB keyboard shows up as 3(!) separate devices of type STICK with the name "09292003".

Anyone else noticed this happening?

- 5parrow

EDIT - Am running WinXP (if that wasn't already implied). I checked Device Manager, and sure enough 3 "extra" devices show up on the same port as the keyboard - probably the silly buttons. I'm still a bit puzzled as to why JInput seems to think they're STICKs given that the system does not know what they are at all.

Oddly enough, the USB keyboard and my laptop keyboard do not register as separate controllers.
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #1 - Posted 2004-06-04 20:40:00 »

Won't help solve your problem, I'm afraid, but...could you send an email to ceo @ grexengine.com with the full details, i.e.:
- make
- model
- manufacturers URL (if you know it)

and I'll add it to the hardware list for Jinput (go to JGF - link in my sig - and in the TECH section there's a set of pages dedicated to JInput).

For now I could add it with details on your problems. If it gets fixed, let me know and I can update it.

The list is short at the moment, but with the help of people like you we will build up a long list of what is known to work and what doesn't (e.g. already we've got several PS2 controller-converters reported as working OK, which is great to know!)

malloc will be first against the wall when the revolution comes...
Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #2 - Posted 2004-06-07 17:59:18 »

Having oddities with an USB keyboard too: It is named KeySonic ACK-610EL and shows up as 2 different devices in Linux (kernel 2.6.5).

The first device is usable but cursor right & cursor down are missing.
The second one has the same name but has nearly no named keys and it does not work anyways. the first visible key is named 'Second Digitiser Stylus Button' ...

and here an image of that:

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #3 - Posted 2004-06-07 19:16:13 »

Seeing that screen shot reminds me... did we ever solve the problem of how to use JInput...  I mean how to know what Key ID to check for?  It seems that we still don't have a way to map between key caps that the user can see on their keyboard and key ids for JInput.  Or maybe I'm just way out of the loop and someone needs to school me on how to program with JInput.  E.g. the key IDs must be standardized across all platforms, mustn't they?

Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #4 - Posted 2004-06-07 21:37:13 »

It was at least tried ... but I am not sure whether it actually works.
endolf defined a mapping between the native definitions and its counterparts in jinput:

buttonIDs[NativeDefinitions.KEY_9] = StandardKeyboard.KeyID._9;
buttonIDs[NativeDefinitions.KEY_0] = StandardKeyboard.KeyID._0;

sometimes that counterparts where not available:
buttonIDs[NativeDefinitions.KEY_F16] = null;
buttonIDs[NativeDefinitions.KEY_F17] = null;
buttonIDs[NativeDefinitions.KEY_F18] = null;

although these are seldom used keys ...

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #5 - Posted 2004-06-07 21:42:45 »

oh and I would be happier if stuff like that:

// Gamepad
buttonIDs[NativeDefinitions.BTN_A] = LinuxDevice.ButtonID.BTN_A;
buttonIDs[NativeDefinitions.BTN_B] = LinuxDevice.ButtonID.BTN_B;
buttonIDs[NativeDefinitions.BTN_C] = LinuxDevice.ButtonID.BTN_C;
buttonIDs[NativeDefinitions.BTN_X] = LinuxDevice.ButtonID.BTN_X;
buttonIDs[NativeDefinitions.BTN_Y] = LinuxDevice.ButtonID.BTN_Y;

would have been simply defined as:

buttonIDs[NativeDefinitions.BTN_A] =
buttonIDs[NativeDefinitions.BTN_B] =
buttonIDs[NativeDefinitions.BTN_C] =
buttonIDs[NativeDefinitions.BTN_X] =
buttonIDs[NativeDefinitions.BTN_Y] = Axis.Identifier.BUTTON;

because LinuxDevice.ButtonID.BTN_C is unknown to a generic Jinput application.
some of that was discussed here: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=jinput;action=display;num=1079729939

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #6 - Posted 2004-06-08 03:49:49 »

Quote
oh and I would be happier if ...
buttonIDs[NativeDefinitions.BTN_A] =
buttonIDs[NativeDefinitions.BTN_B] =
buttonIDs[NativeDefinitions.BTN_C] =
buttonIDs[NativeDefinitions.BTN_X] =
buttonIDs[NativeDefinitions.BTN_Y] = Axis.Identifier.BUTTON;

because LinuxDevice.ButtonID.BTN_C is unknown to a generic Jinput application.


Aren't IDs supposed to be unique?
At least for most game controllers it would be reasonably safe to just number the buttons and make sure the interface allows the buttons to be re-assigned.  The exceptions would be direction pads and such which should have their structure standardized.. Buttons like A,B,C,X,Y,Z, Square, Circle, Triangle, etc...  aren't all that important to standardize because they don't really have any implicit meaning.  Just numbering them would work.   Hat switches and direction pads though should not be treated as arbitrary buttons for sure.  The should be grouped as direction controls.

But..I could be talking nonsense.. it has been too long since I've looked at how it works.

Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #7 - Posted 2004-06-08 08:30:01 »

Are they?

I thought the more important thing is to conclude about the range of getPollData. Axis.Identifier.BUTTONs are never negative, Axis.Identifier.X are in the range  [-b,b] (depending on other values like isNormalized, too).

but uniqueness may be a good idea too.

any ideas Huh

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #8 - Posted 2004-06-08 13:49:52 »

Quote
Are they?

Well I thought so.. but I could be confused.
I thought the ID was key to identifying a specific control, but as I said it has been a long time and I haven't really used JInput... (damn day job steals my time)... I did play around with the Mac plug-in to get support for my gamepad.. but I just ran the standard test code.. I haven't done anything with it as a user of the API.

Offline endolf

JGO Knight


Medals: 7
Projects: 1


Current project release date: sometime in 3003


« Reply #9 - Posted 2004-06-11 13:40:19 »

Hi
 Mmy take on this. The button ID's especially for gamepads are p.i.t.a. as under windows the driver assigns the axes their names, but under linux, the kernel has them set. This means that the ID's are different per OS, however, they could be mapped, like we do for standard keyboards, I don't think it would be too bad, I'm trying to get hold of Jeff to get some input from the team who developed the interface to see what they come back with.

Cheers

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.

xsi3rr4x (64 views)
2014-04-15 18:08:23

BurntPizza (62 views)
2014-04-15 03:46:01

UprightPath (75 views)
2014-04-14 17:39:50

UprightPath (58 views)
2014-04-14 17:35:47

Porlus (76 views)
2014-04-14 15:48:38

tom_mai78101 (101 views)
2014-04-10 04:04:31

BurntPizza (161 views)
2014-04-08 23:06:04

tom_mai78101 (256 views)
2014-04-05 13:34:39

trollwarrior1 (209 views)
2014-04-04 12:06:45

CJLetsGame (216 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!