Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
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  
  making JInput Type Friendly...  (Read 1559 times)
0 Members and 1 Guest are viewing this topic.
Offline mikelomax

Senior Newbie




I know exactly what i'm doing... asking for help


« Posted 2004-09-26 20:00:11 »

As part of my text adventure engine, i need to try to get my inputs suitable for typing text...

trouble is that JInput is a little fast and the best i can do is make it so that it only recognises the first keypress of a particular key - but that slows it down...

so has anyone got any advice or equations that would help perfect a "typing mode"?

Thanks

The reason for having: A firewall

Independance day, the aliens were destroyed because a computer was used to access their network and disable key systems. If they had had a firewall, the earth would be another worthless rock just floating in space
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #1 - Posted 2004-09-26 20:48:01 »

How about AWT?

Kev

Offline mikelomax

Senior Newbie




I know exactly what i'm doing... asking for help


« Reply #2 - Posted 2004-09-26 21:31:07 »

Quote
How about AWT?

Kev


the same problem applies...

i had a version implemented from looking at brackeens book that used AWT but it had the same flaws...

besides i have ideals of going further and using JOGL at some point so won't that make AWT redundant?

The reason for having: A firewall

Independance day, the aliens were destroyed because a computer was used to access their network and disable key systems. If they had had a firewall, the earth would be another worthless rock just floating in space
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #3 - Posted 2004-09-27 07:07:19 »

Nope, infact if you use JOGL then you'll become dependant on AWT.

If you use AWT you could just use KeyListener and keyTyped() which we catch every key the user types.

I'm also not sure how the same problem can apply in AWT. If you're using a KeyListener you *will* get every key pressed and released. It can't "miss" some.

Is it because you're using Console mode and hence have nothing to add the keylistener to?

Kev

Offline mikelomax

Senior Newbie




I know exactly what i'm doing... asking for help


« Reply #4 - Posted 2004-09-27 09:31:44 »

Quote
Nope, infact if you use JOGL then you'll become dependant on AWT.

If you use AWT you could just use KeyListener and keyTyped() which we catch every key the user types.

I'm also not sure how the same problem can apply in AWT. If you're using a KeyListener you *will* get every key pressed and released. It can't "miss" some.

Is it because you're using Console mode and hence have nothing to add the keylistener to?

Kev


No i do have a window i can attach it to, so that isn't a problem...

hmmm, maybe i'll do some more testing... the more i think about it, the more i think that maybe my detection routines are not correct.

Thanks for you advice anyway.

The reason for having: A firewall

Independance day, the aliens were destroyed because a computer was used to access their network and disable key systems. If they had had a firewall, the earth would be another worthless rock just floating in space
Offline TheBohemian

Junior Member




Java will rule them all!


« Reply #5 - Posted 2004-09-29 12:06:36 »

The initial problem sounds similar to what I needed in FFMKI. There are controls which can be continously pressed (e.g. fire buttons) and others which needed a pause. I wrapped everything up in a Control interface having the methods:

1  
2  
boolean isPressed();
void reset();


The magic behind reset() is that it makes isPressed() returning false as long as the user did not release the key, button or axis.

I hope this is what the original poster wanted.

cya

TheBohemian

---------------------------------------
my favorite OS: http://jnode.sf.net
Java 1.5 -> 1.4 converter: http://retroweaver.sf.net
Offline mikelomax

Senior Newbie




I know exactly what i'm doing... asking for help


« Reply #6 - Posted 2004-09-29 19:40:50 »

Quote
The initial problem sounds similar to what I needed in FFMKI. There are controls which can be continously pressed (e.g. fire buttons) and others which needed a pause. I wrapped everything up in a Control interface having the methods:

1  
2  
boolean isPressed();
void reset();


The magic behind reset() is that it makes isPressed() returning false as long as the user did not release the key, button or axis.

I hope this is what the original poster wanted.


not exactly, but thanks for the idea... i have already something like that.

the problem was, and still is till i finish it, was that i was asking if there was a way or any code available to make JInput behave in a way similar to how a keyboard types (i.e. it detects the intial press, pauses, then detects the press continuously. or things like detect num lock, caps lock, etc.)

i've got no problem with the inputs... i just need them to behave in a certain way...

The reason for having: A firewall

Independance day, the aliens were destroyed because a computer was used to access their network and disable key systems. If they had had a firewall, the earth would be another worthless rock just floating in space
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.

pw (15 views)
2014-07-24 01:59:36

Riven (14 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (51 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!