Animations problem

I got a question and some problems with animations.

  1. Is there any easy way to check for using specified button press during animation/current button pressed? I mean: when I hold W, A, S or D all the time and I in moment press L Shift, the current animation (walk) will be break and new animation(run) will be played until I release it. (if i release and still press WASD walk anim will continue)

And I got some problems with attack anims. I just wanna get random attack anim when click/press LPM.
So here’s the code of method for random and if statement:
[java]} else if (hit) {
if (channel.getAnimationName() == null) {

[java] private String getRandomAnim() {
Random random = new Random();
int a = random.nextInt(4);
if (a == 0) {
return currentAnim = anim1;
} else if (a == 1) {
return currentAnim = anim2;
} else if (a == 2) {
return currentAnim = anim3;
} else if (a == 3) {
return currentAnim = anim4;
return currentAnim;
When I click once LPM each mesh is using different animation because draw method is calling few times. Why? Because I call it in update method and in “for each spatial statement”. So for each from 8 meshes draw is calling. How can I fix that?

And another problem. I just want call attack animation once when just click/press LPM. Atm I must hold all the time the LPM button to get animation until the end. Is here problem with onAction method or just there’s a way to
distinguish a click from pressing/holding down?