Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
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  
  AWT events or JInput?  (Read 1607 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Posted 2003-10-13 14:50:45 »

Now I need to add user input (finally!) to my game, but I'm stuck trying to figure out exactly how much of JInput I actually need.

I'm going to need keyboard, mouse and joypad input eventually, but for now I only really need the keyboard (and possibly joypad to test how it works). Now since I'm using Jogl for my  games display attaching a regular old KeyListener is a minimum amount of hastle and something that I know will reliably work. A few classes to handle the incomming up & down events into a set of boolean isPressed flags and I'm all set.

Obviously for joypad support I'm going to need JInput, and for the existing editor input I'm already using AWT mouse events, so I'm going to end up with both anyway.

But would JInput keyboard support gain me anything? I see it has the .isKeyPressed() written for me. While this is handy, I already have something that does this (and makes it easy to remap controls in the process). In switching to keyboard JInput, am i loosing compatability with any platforms?

Ooo, I also see a Rumbler interface, does this actually work? Would be nice to get feedback though my pad Grin

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline gregorypierce

Senior Member




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


« Reply #1 - Posted 2003-10-14 00:12:04 »

The JInput stuff is closer to the hardware and lower latency having queued input as mandated by the operating systems best available gaming APIs. It would be good for you to use it overall and give us some feedback if you come up with something you need added/changed - but I don't think there is anything that you will be able to do in AWT that hasn't already been addressed in JINput in some manner or other.

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 William Denniss

JGO Coder


Projects: 2


Fire at will


« Reply #2 - Posted 2003-10-14 00:59:43 »

I'm not sure how important linux support is you, but since JInput doesn't work on Linux 2.4.x I'd be keeping AWT events for now (if only as a choosable option).

Cheers,

Will.

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

JGO Coder




Got any cats?


« Reply #3 - Posted 2003-10-15 00:42:13 »

Note: In the original Win32 release I didn't have time to re-implement rumble under DX9.

It may still need a poke or two to get it functional on Wintel.


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 endolf

JGO Coder


Medals: 7


Current project release date: sometime in 3003


« Reply #4 - Posted 2003-10-15 07:08:22 »

Hi
 Depends on whether you want the keyboard mapped to the local mapping (ie, uk users with uk keyboard layouts), or wether you force it to US all the time (even if it's say russian). The keyboard stuff isn't that great if you ask me, it goes to a lower level, and under linux at least you don't know what layout it is at that level (and it only works in 2.6 kernels unless it's a USB keyboard). Mouse support still has some issues if you get the poll time wrong, I can regularly run the readtest application and clikc from window to window and see nothign happen in the mouse button window. On the birght side, unless you are an awkward sod and use a gamecube joypad (prod prod) then the gamepad/joystick support works well Smiley

And yes, rumblers as still not functional, not sure about macos, but certainly linux and windows don't support them yet.

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.

BurntPizza (24 views)
2014-09-21 02:42:18

BurntPizza (15 views)
2014-09-21 01:30:30

moogie (18 views)
2014-09-21 00:26:15

UprightPath (25 views)
2014-09-20 20:14:06

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

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

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

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

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

mitcheeb (70 views)
2014-09-08 06:06:29
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!