Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 [2]
  ignore  |  Print  
  JInput webstart demo  (Read 7265 times)
0 Members and 1 Guest are viewing this topic.
Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #30 - Posted 2004-02-26 18:03:56 »

Well I've got hard-coded tables from some other Apple mailing lists.. the problem of course is that they don't cover the various keyboard layouts.  The one that comes up most often is German... and I would like for Germans to be able to play a game I make.

Update:  I just got a reply from George Warner at Apple.  

Quote
You may want to look at the sample HID source code "HID Utilities" at:

http://developer.apple.com/samplecode/Sample_Code/Devices_and_Hardware/HID_Manager/HID_Utilities_Source.htm

The (English) HID usage strings are in "HID_usage_strings.plist" which is an
XML file that can be loaded and searched via the "HIDGetUsageName" function
in <HID_Name_Lookup.c>.


... sounds like he is really just pointing me to another hard-coded table.  I'll prod him for more info on an international solution.

However another developer has responded:
Quote
You should not use a hard coded table to get to the key labels but a hard coded table to get to the virtual key codes instead. I believe you can pull one from one of the headers of the OS 9 USB SDK. Next you can use calls such as KeyTranslate and UCKeyTranslate to convert your virtual key codes to the right keys taking into acount the international keyboard layout.

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #31 - Posted 2004-02-27 15:35:08 »

The qualifier keys not working on the powerbook appears to be a bug in the JInput plugin.  Apples HID Explorer shows the state of keys like CTRL changing.  (Keyboard Usage 0xe0)

Offline gregorypierce

Senior Member




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


« Reply #32 - Posted 2004-02-28 00:59:09 »

The bug was in Apple's enumeration code. There qualifier keys are being enumerated more than once. I changed the code such that only the first key that gets enumerated is used. This is a HUGE assumption, but it works 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!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline TheAnalogKid

JGO Coder


Projects: 2



« Reply #33 - Posted 2004-07-15 17:33:39 »

Hello everyone!

Sorry if the question has already been answered but I'm not able to know the required java property(ies) to get jinput working with java webstart?

Can anyone copy paste them for me please?

thanks

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #34 - Posted 2004-07-19 06:03:47 »

Read the intro threads, one of them covers exactly this.

HTH

Endolf

Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #35 - Posted 2004-07-19 12:10:48 »

Modified my intro post:

  • highlighted the properterty
  • added a list of known class names

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 #36 - Posted 2004-07-20 14:14:22 »

We should really use the Wiki more for this sort of thing... better than trying to find a post here.

Offline JuddMan

Senior Member


Medals: 1


Your Ad Here


« Reply #37 - Posted 2004-07-24 19:12:36 »

now i know you may have heard this before, but for those still having a hard time with jinput and webstart...

read through the JNLP file that is used to launch the webstart demo. most of it is pretty standard, but mainly what you need to look at are the sections for each individual OS. eg:


 [size=3]<resources os="Mac OS">
   <j2se href="http://java.sun.com/products/autodl/j2se" version="1.4+"/>    
  <property name="jinput.plugins" value="net.java.games.input.OSXEnvironmentPlugin" />
   <jar href="HIDWrapper.jar"/>
   <nativelib href="jinput-osx-native.jar"/>
 </resources>
[/size]


The property tag named jinput.plugins must point to the class that is the plugin you are using for the OS. (eg. for macOS: net.java.games.input.OSXEnvironmentPlugin).

if you're distrtibuting the native libs in the same way this demo did then you shouldn't really need to alter the property from those shown in that JNLP.

to distribute the actual native binaries, you just have to jar them like you would any other class and sign them with the same keystore you did your main game jar. the nativelib tag will allow webstart to handle them properly. you don't even need to make your own manifest file for these jars.

this's an example of what i do to prepare the native binaries:
[size=3]
jar -cvf JInputWindowsNative.jar dxinput.dll
jarsigner JInputWindowsNative.jar mykey
[/size]


you also need to sign all the jinput jar files you are distributing with your own key as well.
Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #38 - Posted 2005-06-28 10:06:16 »

Hi

There have been a few changes with jinput recently so I've gone back and updated the webstart demo. It's now available here. I've tried it on windows and linux, and works as well as it does from the command line. If you look at the jnlp you'll see that there is no longer a need for the property. There are 3 jars containing just java, 1 for each platform. The data size could be reduced by pulling the plugins out, so there would be 1 shared jar, and 1 for each platform, but that's an exercise for the reader Smiley.

Endolf

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #39 - Posted 2005-06-28 21:25:27 »

First, thanks for getting the builds sorted, nice job. Sorry.. now on to the moan:

Right, I'm totally confused now then.. and yes I know it doesn't take much.

a) The packages I can download either form the jinput site (or direct from newdawn) only contain binary files for windows. I.e. I can get a dll but I can't get a .so or a .jnilib.

b) Having given up on just getting a normal distribution I thought I'd steal what I needed from the webstart - however:
    - I thought there was now just one common java jar between all platforms. That appears not be the cast since there is a jinput java jar in each platform jar (all of which are different sizes).
    - Each of the jars is actually expanded into the outer jar aswell. Not sure why this is, but got me even more confused.
    - I've got the natives out now, but I'm also confused why the natives are appearing in both the jars refered to in the JNLP (i.e. libjinput-linux.so appears in both jinput-linux.jar and jinput-linux-native.jar)

So, wtf is going on?

Kev

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

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #40 - Posted 2005-06-29 09:12:26 »

Hi

Ok, I messed up the webstart ant script that compiles the jars. I've updated it and uploaded the results, far smaller Smiley

I'm not sure what you mean by the packages not having the other binaries. On the server where the files are I just did

1  
2  
3  
4  
5  
6  
7  
$ tar -tzf jinput_linux_2005-06-19.tgz
jinput.jar
libjinput-linux.so

$ tar -tzf jinput_osx_2005-06-27.tgz
jinput.jar
libjinput.jnilib


so the .so and .jnilib are there

There are 4 parts that each platform needs, the jutils jar for the plugin components, the coreAPI parts, the java plugin parts, and the native lib parts. Unlike jogl for example, the platform specific plugins do *not* have a common native interface. Where jogl has all the java parts in common on all platforms, jinput doesn't. I *could* have created a shared jar that contained the coreAPI components and the jutils parts, and then for each platform have a java plugin jar and a native lib jar. This would have saved on server disk space. What I ended up doing, was for each platform, putting the coreAPI, jutils and the java plugin parts in one jar, and the lib in another. I thought this would make it simple for people to steal the jars from where they are now if they wanted too. Also, server disk space is not an issue.

Endolf

Offline kevglass

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #41 - Posted 2005-06-29 09:16:13 »

Could be a Winzip <-> tgz thing I guess.. I check again tonight.

What I'm really confused about is the single jar thing. I though there was now

1 uber jar for all java
3 native libs.

?

Kev

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #42 - Posted 2005-06-29 09:19:28 »

You responded whilst I was adding the explination to my above post Smiley

Endolf

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #43 - Posted 2005-07-14 01:22:24 »

I think you should name the jar files distinctly then.  eg. jinput_win32.jar, jinput_linux.jar,  jinput_osx.jar

When Java people see a JAR file they don't think of it being platform specific.

Offline endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #44 - Posted 2005-07-16 12:59:24 »

Hi

They are. Check out the listing of the files here

Endolf.

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #45 - Posted 2005-07-17 01:38:25 »

Ah, I was commenting based on the message three spaces up that showed the contents of the .tgz files.  That showed just "jinput.jar"

Pages: 1 [2]
  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.

BurntPizza (22 views)
2014-09-19 03:14:18

Dwinin (35 views)
2014-09-12 09:08:26

Norakomi (63 views)
2014-09-10 13:57:51

TehJavaDev (90 views)
2014-09-10 06:39:09

Tekkerue (44 views)
2014-09-09 02:24:56

mitcheeb (65 views)
2014-09-08 06:06:29

BurntPizza (48 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (40 views)
2014-09-07 01:11:22

Longarmx (37 views)
2014-09-07 01:10:19
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!