making JInput Type Friendly...

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

How about AWT?

Kev

[quote]How about AWT?

Kev
[/quote]
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?

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

[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
[/quote]
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 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:


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.

[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:


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.
[/quote]
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…