Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
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  (Read 1886 times)
0 Members and 1 Guest are viewing this topic.
Offline rouncer

Junior Devvie





« Posted 2010-04-21 12:31:53 »

Ive downloaded Jinput, and its a couple of .jar files and some dll's.

What do I do with it? (i'm using Eclipse) And what is a .jar file?
Offline rouncer

Junior Devvie





« Reply #1 - Posted 2010-04-21 16:29:12 »

Silly me, a jar file is a java source file, but for some reason I clicked on the jitest.jar but it didnt even load up!
Ill work it out, but if someone could tell me how to even view a jar file in eclipse it would help (i know it sounds stupid)
Offline Nate

« JGO Bitwise Duke »


Medals: 158
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #2 - Posted 2010-04-21 18:56:22 »

A brief Googling would probably find your answers.

A JAR file is not a Java source file. It is a special zip file that contains compiled Java class files. Add it to the build path of your Eclipse project.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Shane75776
« Reply #3 - Posted 2010-04-21 20:33:26 »

You sound like you are new to java to me. Anyways what is it that you need to use this "JInput" for (I have never heard of it) and I might be able to help you out.

Check out my Snipping Tool++ ! An advanced snippet/screenshot/text uploading tool! Meant to replace the windows snipping tool.

Check out Pixel Rain My most recent Swing based game!
Offline Shane75776
« Reply #4 - Posted 2010-04-21 20:52:49 »

To use the contents of the JInput.jar file for Eclipse users do the following.

1. Make an folder to put the JInput.jar in maybe call it "External Jars" here you can store any jars that you download and can easily find them in the same place for future use.

2. In Eclipse, locate the project folder and click the drop down arrow of the project in which you are going to be using this jars resources.

3. Right Click JRE System Library> Build Path> Configure Build Path

4. Click Add External Jars

5. Locate the folder you have your JInput.jar in and select the jar and click open.

6. Click OK on the Java Build Path window.

Now that you have your jar in your build path the next step is to import it at the top of any class file that will be using the methods from within the jar.

And thats it, hope it helped Cheesy

Check out my Snipping Tool++ ! An advanced snippet/screenshot/text uploading tool! Meant to replace the windows snipping tool.

Check out Pixel Rain My most recent Swing based game!
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #5 - Posted 2010-04-22 06:02:18 »

That will get you compiling, to run it you need to make sure the natives for your platform are in the java.library.path. In eclipse, you can right click on the jar file and somewhere in the following menus select the location of the native library.

HTH

Endolf

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #6 - Posted 2010-04-22 06:04:01 »

Anyways what is it that you need to use this "JInput" for (I have never heard of it).

JInput is an API that allows access to input devices from Java, it uses the platform APIs to get the data. It currently has bindings for windows, linux and osx.

We have our own forums right here on jgo Smiley.

Endolf

Offline Nate

« JGO Bitwise Duke »


Medals: 158
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2010-04-22 07:09:31 »

From a hint in another thread, I believe rouncer wants to capture mouse input outside his game window. Microsoft recommends using the window proc to handle keyboard and mouse input because it has the least overhead, rather then doing keyboard and mouse input through DirectInput. JInput is plugin based, but on Windows typically uses DirectInput. I assume JInput keyboard/mouse access is done through DirectInput (since it doesn't know anything about the game window) and may not be ideal if what you want is basic keyboard/mouse access for your game. JInput is still useful for all other peripherals though, such as joysticks, gamepads, rudders, wheels, etc.

FWIW, LWJGL makes use of JInput, but handles the mouse and keyboard through the window proc. LWJGL doesn't track the mouse outside the game window, and I'm sure there is a compelling reason this is so. Maybe an LWJGL guy can weigh in on why this is? I'd guess Windows doesn't give the game window mouse movement messages, so the only other solution would be a system level hook. This is resource intensive and I can see LWJGL not wanting to do this.

Using either JInput or a system hook is less than ideal. Either may prove to be an acceptable workaround to handling out of window mouse events. If so, JInput is certainly an easier solution since you don't have to write native code. I just wanted to point out why you are having this problem in the first place.

Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #8 - Posted 2010-04-22 08:00:38 »

The default plugin for windows xp/vista/7 uses direct input for gamepads/joysticks only, it uses the raw input for mice and keyboards so it might not be 'less than ideal', that said, LWJGL does indeed do it itself to avoid some of the nasty we have to deal with to provide a platform agnostic interface and indeed a windowless one.

Endolf

Offline rouncer

Junior Devvie





« Reply #9 - Posted 2010-04-22 09:39:17 »

Endolf is what im after, but before I even get to using it I have to link to it properly and I got to do what shane said to do, thanks shane.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Shane75776
« Reply #10 - Posted 2010-04-22 12:37:24 »

Your welcome  Smiley

Check out my Snipping Tool++ ! An advanced snippet/screenshot/text uploading tool! Meant to replace the windows snipping tool.

Check out Pixel Rain My most recent Swing based game!
Offline rouncer

Junior Devvie





« Reply #11 - Posted 2010-04-22 13:22:51 »

Ive gotten through what Shane told me to do, Ive got the jar files as referenced libraries, but now im stuck again.
Could anyone supply a java source file of jinput in action?  I find I work best off code, im just not sure how to start or even how to type in how to import it properly at the top.
Offline endolf

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #12 - Posted 2010-04-22 15:10:37 »

Have you read the JInput Getting started thread?, it contains code.

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.

trollwarrior1 (28 views)
2014-11-22 12:13:56

xFryIx (70 views)
2014-11-13 12:34:49

digdugdiggy (49 views)
2014-11-12 21:11:50

digdugdiggy (43 views)
2014-11-12 21:10:15

digdugdiggy (37 views)
2014-11-12 21:09:33

kovacsa (61 views)
2014-11-07 19:57:14

TehJavaDev (65 views)
2014-11-03 22:04:50

BurntPizza (63 views)
2014-11-03 18:54:52

moogie (79 views)
2014-11-03 06:22:04

CopyableCougar4 (78 views)
2014-11-01 23:36:41
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!