Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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  
  OSX Update  (Read 4792 times)
0 Members and 1 Guest are viewing this topic.
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Posted 2003-07-26 04:57:06 »

'MKay. I've started checking in stuff for the OSX release and plan to have a running build before the end of the weekend. Currently I have checked in native code that enumerates the input devices and prints their capabilities to the console.

Next step is to map these funky HID hexcodes into features that JInput uses. For now I have to let it be known that I am intentionally mapping AROUND the mouse, because nothing is more annoying that losing control of the mouse while developing Smiley It DOES get enumerated - you just can't use it yet. It will likely be the last device I support .. unless tomorrow's release is a lot more stable.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #1 - Posted 2003-07-26 18:58:45 »

Jeff, if you have the ability to get some OSX gamepads and the like - drop me a line Smiley

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #2 - Posted 2003-07-27 03:02:07 »

I will be testing with a Macally iShock II USB force feedback game controller on a 1GHz TiBook. Just in case you want to purchase something different to get more coverage of available devices.

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

Junior Member




ROCK!!!


« Reply #3 - Posted 2003-07-28 02:28:26 »

I have a Logitech Wheel I can test with, I think. It's designed for the PS2 and games like Gran Tursimo but I'm told it works on the PC and I'm gonna assume OS X.

The wheel has a good number of buttons and foot pedals and force feedback and rumble feature.
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #4 - Posted 2003-07-28 14:43:15 »

Was just able to confirm with Scott that at the moment the native library can at the very least find all of the devices that are attached to your machine using HID and return information about them to Java. One of the hardest parts of the binding is apparently behind us.

Now to cobble together some time to finish and get the rest of the integration done. The OSX port is a little bit different from the DX8 port in that the binding code is a little more isolated. JInput calls the binding JNIWrapper. I did this mostly to give the LWJGL folks the ability to integrate with native OSX input without having to deal with JInput directly.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #5 - Posted 2003-07-29 16:39:40 »

Started on the actal JInput integration. Since I'm following the same code path that the DX8 route went for portability I'm not going to be able to have a binding within a binding so the LWJGL folks will just have to take a look at the source and port from the available JInput source. I'll keep it as separable as possible though.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #6 - Posted 2003-07-30 06:37:46 »

The latest JNIWrapper class and native library are located at my blog site as indicated below.

Things are coming along swimmingly. At the moment you can query all the devices, open and close them from the Java interface, and get the devices capabilities from the device (kinda sorta mostly).

The final step is coming much faster than I anticipated - polling with the devices and moving data from the queues that the OSX HID Manager maintains to the Java layer so that developers can determine what it means/what they want to do with it. I'm not going to get into keymaps, redefining keys and what not - you're big boys Smiley The HID manager pretty much treats the keyboard as one big-ass gamepad with each key having a min/max of 0/1 and you'll be able to get buffered keyboard state from it.. in fact you won't have any choice as all input in the OSX system will be buffered whether you want it that way or not (because that's how the HID API works).

Feels good to almost be through with this piece so that I can move on to OpenAL (ugh I hate that API), and then come back and start doing some serious smackdown on JOGL itself.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #7 - Posted 2003-07-30 06:38:55 »

Note, if you want to try it out - just download the files and run the main method of JNIWrapper (for now).

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline aNt

Senior Member




AFK


« Reply #8 - Posted 2003-07-30 09:45:32 »

dude its strange (not looked at input stuff in an age). wooo its great stuff. works tip top fine here on my TiBook. going to find a very odd controller around the office here (we make the odd bit of hardware). and give that a try Smiley

nice job!
Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #9 - Posted 2003-08-01 17:24:01 »

I now have a release of the OSX build polling devices into queues and the Java side being able to pull data from those input queues. Apple does something funky with defining event types on the queues however so I need to sort through this before I can do a release. Seems you tell a queue which keys/buttons whose events you want to show up on the queue, which while interesting just seems horribly wrong somehow. It should just get events from the device and add them to the queue, not require that I tell it I want events for button/key/axis/etc. Once this gets sorted out this weekend I'll have something nearing a final release of JInput for OSX.

I need to talk to an Apple dev and find out what they were thinking when they designed this subsystem. Once I can mindmeld with that person(s) I can wrap things up.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
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 #10 - Posted 2003-08-01 22:26:42 »

Hmm. sounds similar to the Amiga event system.  It has advantages.  By only getting events that you actually care about a thread that is waiting on an event won't wake up and cause a context switch only to decide that it really has nothing to do.  E.g. why send every single mouse move to a program that doesn't use the mouse?

I'm not sure if what you are saying works the same way, but in any case it shouldn't be too hard to work around.

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #11 - Posted 2003-08-02 03:24:26 »

Is it reasonably easy to work around - kinda. Its really a pain in the ass because that means that I have to go and essentially set up listeners for every key, axis, etc on every device as that's where the data comes from.

Its not similar to your example, because a program that doesn't use the mouse would not open the mouse. But having a program that uses the mouse go in and add events for every wheel, button, and axis is just stupid from an API perspective. No good ever comes of that. This is a good example of a piece of API that is over designed.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Jeff

JGO Coder




Got any cats?


« Reply #12 - Posted 2003-08-02 05:00:48 »

Hey Guys,

My apologies on being gone a few days.. STILL dealing with moving the last of my stuff and emptying my house.

Greg, yeah I can get you a USB pad pretty easy.  Email me at jeffrey.kesselman@sun.com with snail mail details and Ill try to post you something next week.

Terrific going on the OSX stuff.  I need to update the Win32 mouse as it has been pointed out to me that it could be more useful if it returned non-normalized data.  (I inherited the code thats there, actually.)  We probably want to come up with an agreement on what mice return so its the same across all plug-ins.

Thanks for all the effort on this.

JK

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 gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #13 - Posted 2003-08-08 18:24:29 »

Quote

Testing keyboard on an Apple Powerbook (15" 1GHz)...  The EA.4 release with OS X 10.2.6
 
The following keys are not reporting any changes:
\
shift (both left and right)
ctrl
option/alt
apple/meta (left and right)
enter (not the main Return key.. this is down beside the cursors and apple key on my PB, maybe considered part of the numpad?)
PgUp
PgDn
cursor down
 
There are other very special purpose keys that don't get reported, but I'm not sure that it matters.  These include the eject key, volume up/down, mute, screen brightness up/down.. also numlock - maybe it matters?
 
Overall it's looking good. trackpad and USB mouse works fine.  Alothough trackpad reports an extra button.  There is only one button, it shows 2. The second button can't be pressed even with ctrl-click which is the normal Mac shortcut for context menus with a single button mouse)
 
Nice work GP.                          


Okay I've taken a look at those bugs and I can address some of them. The special keys don't get mapped because JInput doesn't have a Key binding for them. The binding knows about them and is listening to them, but there is no call from JInput that will ever get information from them.

Page Up is mapped to 0x4B (no mapping)
Page Down is mapped to 0x4E (no mapping)
Forward slash \ is mapped to 0x64 in HID (no mapping)

Not sure what's going on with the down arrow as it is mapped properly. I'll check it on a regular keyboard and see what happens.

I suspect that there may be some keycodes on the Powerbook keyboard that are different than the standard ones. I'll take a look at it tonight because all of the metas are mapped properly so I'm truly surprised they aren't getting reported properly.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #14 - Posted 2003-08-08 18:32:25 »

Quote
Forward slash \ is mapped to 0x64 in HID (no mapping)

Psssst.. thats a backslash.

The missing keys need to be added to JInput then.  PgUp/PgDn aren't all that special nor is backslash.   Things like eject and volume adjustments are in a different category so if they are missing nobody is likely to care.

Actually.. what about those fancy multimedia keyboards with volume, play, stop, FF, rewind, email, browse, scroll wheels etc..  They are fairly popular now.

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #15 - Posted 2003-08-08 20:33:23 »

With Logitech iTouch keyboard:
During enumeration...

java.lang.NullPointerException
       at net.java.games.input.OSXEnvironmentPlugin.addControllerElement(OSXEnvironmentPlugin.java:432)
       at net.java.games.input.OSXEnvironmentPlugin.enumDevices(Native Method)
       at net.java.games.input.OSXEnvironmentPlugin.<init>(OSXEnvironmentPlugin.java:335)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
       at java.lang.Class.newInstance0(Class.java:306)
       at java.lang.Class.newInstance(Class.java:259)
       at net.java.games.input.DefaultControllerEnvironment.scanControllersAt(DefaultControllerEnvironment.java:183)
       at net.java.games.input.DefaultControllerEnvironment.scanControllers(DefaultControllerEnvironment.java:164)
       at net.java.games.input.DefaultControllerEnvironment.access$000(DefaultControllerEnvironment.java:57)
       at net.java.games.input.DefaultControllerEnvironment$1.run(DefaultControllerEnvironment.java:108)
       at java.security.AccessController.doPrivileged(Native Method)
       at net.java.games.input.DefaultControllerEnvironment.getControllers(DefaultControllerEnvironment.java:106)
       at net.java.games.input.test.ControllerReadTest.<init>(ControllerReadTest.java:239)
       at net.java.games.input.test.ControllerReadTest.main(ControllerReadTest.java:288)


Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #16 - Posted 2003-08-09 16:18:25 »

This is unfortunately Logitech's fault as the Logitech keyboard defines itself as TWO HID devices as opposed to one device with two sub devices. All I can do is put in a wrapper to have it throw out the device if it can't identify it as a keyboard, mouse, gamepad, joystick. The iTouch tries to show its USB hub as an input device - which clearly it isn't.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Jeff

JGO Coder




Got any cats?


« Reply #17 - Posted 2003-08-12 03:47:37 »

Hey Guys.

We are just finishign up gettign automated build of Win32 workign and will likely start working on autobuild for OSX soon....

Which leads me to this question:  do you have a build.xml hiding somewhere for the OSX plug-in?


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 swpalmer

JGO Coder




Where's the Kaboom?


« Reply #18 - Posted 2003-08-12 04:04:25 »

I made some changes to the main build.xml and created some for the OS X specifics.  I gave them to GP, since I haven't yet managed to remember to send in the paperwork to get a developer role...   I only have the time to do small things like the build file anyway, but I figure I should probably sign up as every little bit helps.
If I'm lucky I will have a chance to become more familiar with JInput and the OS X input APIs so I can assist with the gamepad integration.  But chances are GP will have a gamepad device to test with before I get that far.

Offline gregorypierce

Senior Member




I come upon thee like the blue screen of death....


« Reply #19 - Posted 2003-08-12 15:33:48 »

Yep, thanks to Jeff and the fine folks at Sun I have a controller which I will plug into my Mac when I get home and hack away at gamepad integration. The gamepad should be as easy as the mouse was. Its the keyboard that's a PITA.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
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.

pw (11 views)
2014-07-24 01:59:36

Riven (10 views)
2014-07-23 21:16:32

Riven (11 views)
2014-07-23 21:07:15

Riven (12 views)
2014-07-23 20:56:16

ctomni231 (42 views)
2014-07-18 06:55:21

Zero Volt (38 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (34 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!