Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (755)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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 2717 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel

Medals: 57
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

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

Senior Devvie

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.

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).



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!
Offline endolf

JGO Coder

Medals: 7
Exp: 15 years

Current project release date: sometime in 3003

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

 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.


Pages: [1]
  ignore  |  Print  

DesertCoockie (36 views)
2018-05-13 18:23:11

nelsongames (82 views)
2018-04-24 18:15:36

nelsongames (74 views)
2018-04-24 18:14:32

ivj94 (756 views)
2018-03-24 14:47:39

ivj94 (86 views)
2018-03-24 14:46:31

ivj94 (626 views)
2018-03-24 14:43:53

Solater (101 views)
2018-03-17 05:04:08

nelsongames (182 views)
2018-03-05 17:56:34

Gornova (409 views)
2018-03-02 22:15:33

buddyBro (1069 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!