I had the same problem on redhat 7.2
The way I got around it was to keep track of the first
time it was released and then always perform the
action one more time (ignoring the first release). So
on windows the first release is ignored but after that
it isn't and so we don't move. On linux the first
release is ignored (which really isn't a release) and
so the code is executed one more time and then the
KeyPressed event comes along and we've never stopped
executing. This is assuming you have a similar setup
to KeyNavigatorBehavior where all the events are saved
until a new frame and then they are all sent at once.
PSUEDO CODE:
if(release)
{
oldKeyPress = keyPress;
firstTime = true;
}
later in code...
if(keyPress == UP || (firstTime && oldKeyPress == UP))
{
move(UP);
firstTime = false;
}
Not very clean and makes my behavior run 100% of the
time (even when no keys are pressed).
Let me know if you find a cleaner way.
--- John Wright <[EMAIL PROTECTED]> wrote:
> Martin,
>
> Perhaps you could have your Java application make
> the modification to
> Linux directly?
>
> Or perhaps as a clumsy work around use a timer and
> ignore any KeyRelease
> that occurs if it is immediately followed by a
> "KeyPress".
>
> This seems like strange behavior for Linux as it
> defeats the whole
> concept of distinguishing between "KeyTyped" and
> "KeyPress/KeyRelease".
> Do you know if this is unique to Debian Linux? (I've
> not noticed it with
> Caldera or RedHat)
>
> - John Wright
> Starfire Research
>
> Martin wrote:
> >
> > I posted the post below earlier and wanted to give
> up an update!
> >
> > I have solved... kind off... what was causing the
> KeyRelease... It's the
> > KeyRepeat mechanisum of my OS (Debian-Linux). I
> changed the setting and the
> > release stopped!
> >
> > Anyone know of a way to Override this directly via
> my Program? Having all
> > users change this setting is going to impact any
> planned Distribution of my
> > software so I need to find someway of automaticaly
> dealing with this
> > Directly.
> >
> > Cheers... Martin.
> >
> > > Hi.
> > > I'm having a problem and need some help or
> advise.
> > >
> > > Ive created a scene that uses two Behaviors. One
> that uses a
> > > WakeupOnElapsedFrames criterion triggered by an
> Alpha object and another
> > > that uses two WakeupOnAWTEvent criterion,
> KeyEvent.KEY_PRESSED &
> > > KeyEvent.KEY_RELEASED.
> > >
> > > I'm changing the state of a boolean variable
> with the KeyEvents Behavior
> > > and the Alpha triggerd Behavior perform the
> actual animation depending on
> > > boolean state.
> > >
> > > My problem is that my KEY_PRESSED event is
> automaticaly performing a
> > > KEY_RELEASE after about a second resetting my
> boolean variable, dispite the
> > > fact me fingers still on key?
> > >
> > > Is there a way to cancel out the autorelease? Or
> is it an OS thing? (Ive
> > > just changed over to Linux from Win2K and am not
> 100% sure on my system
> > > syability)
> > >
> > > Martin.
> >
> >
>
===========================================================================
> > To unsubscribe, send email to
> [EMAIL PROTECTED] and include in the body
> > of the message "signoff JAVA3D-INTEREST". For
> general help, send email to
> > [EMAIL PROTECTED] and include in the body of
> the message "help".
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED]
> and include in the body
> of the message "signoff JAVA3D-INTEREST". For
> general help, send email to
> [EMAIL PROTECTED] and include in the body of the
> message "help".
=====
See you later,
Brandon
-------------------------------
"Don't take it too seriously it's just life we'll win in the end." Superchic[k]
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".