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

Junior Devvie




Miles away from here!


« Posted 2004-07-27 15:00:37 »

For a game that only uses keyboard input, would JInput provide that much of performance gain. At the moment I am using:

[CODE]Toolkit.getDefaultToolkit().addAWTEventListener(new MyAWTEventListener(),AWTEvent.KEY_EVENT_MASK);[/CODE]

and then in the eventDispatched() method of listener a switch statement.
Offline JuddMan

Senior Devvie


Medals: 1


Your Ad Here


« Reply #1 - Posted 2004-07-28 08:34:49 »

it's not so much a matter of performance but the question of whether you want to use AWT in the first place. JInput is your only choice for controllers other than keyb and mouse of course, so if you plan on using something else as well in the future you might as well go straight for jinput.

JInput can read controllers when the window is not in focus.

where you do not use AWT to do your drawing, you are limited on input too.

I would use JInput for a fullscreen game, a game that uses controller input, and even a windowed game but that's just because i am used to it now.

i really dont think you are going to notice any diference in the performance between them. there are other places in most games where optimizing is much more beneficial (like graphics).

if you are after response times, awt is great, jinput depends on how often you poll. it's usually best to poll at least every frame, then it's just as good.

AWT listeners can be serialized, which is convenient to save your config.
Offline gregof

Junior Devvie




in code we trust


« Reply #2 - Posted 2004-07-28 08:51:35 »

Another issue is that I dont think JInput has any way of handling different keyboard layouts automaticly as awt does, so if you dont have an US-en (I think) keymap or wish to support different keymaps you will have to handle that yourself.

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

JGO Coder


Medals: 7
Exp: 15 years


Current project release date: sometime in 3003


« Reply #3 - Posted 2004-07-28 09:15:32 »

Hi
 It's down to the OS, I have no idea what osx does in this respect. The linux kernel does no mapping (all handled outside of the kernel), so when talking with it there doesn't appear to be a way without writting a whole load of keymaps myself. Direct X sits above the windows kernel after the keyboard mapping is done, so on windows it's fine, on osx I suspect it is, it's only linux that is a little funny. As the console can have keyboard maps I assume there is someway to do it, but I need to explore further.
 Elsewhere I have said that I am planning on doing an AWT plugin for jinput for mouse and keyboard control, this will mean that you can use which ever you feel like from jinput without worrying about having to re-write your input layer. It's on the list, but a server crash has meant I've spent my free time the last few nights building a new mail/dns and web server box.

Endolf

Offline gregof

Junior Devvie




in code we trust


« Reply #4 - Posted 2004-07-28 10:00:15 »

Of course, I run Linux...  Wink

// Gregof
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.

toopeicgaming1999 (72 views)
2014-11-26 15:22:04

toopeicgaming1999 (62 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16

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

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

digdugdiggy (56 views)
2014-11-12 21:11:50
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!