Page 1 of 1

quick question mouse key

Posted: Sun Jun 20, 2004 7:55 pm
by RizzleR
when i map this:

Keys[EPA_MOVE_FORWARD] = irr::KEY_RBUTTON;

i doesn't work ingame

Posted: Mon Jun 21, 2004 6:30 am
by Endar
Okay, are you trying to use an array of "SKeyMap"? If you are then each array element actually has two parts. I think it's a struct or like a struct, anyway, off track.

If you are using "SKeyMap" then each array element has an 'Action' part and a 'KeyCode' part.

Code: Select all

keyMap[0].Action = EKA_MOVE_FORWARD;
keyMap[0].KeyCode = KEY_UP;
keyMap[1].Action = EKA_MOVE_BACKWARD;
keyMap[1].KeyCode = KEY_DOWN;
keyMap[2].Action = EKA_STRAFE_LEFT;
keyMap[2].KeyCode = KEY_LEFT;
keyMap[3].Action = EKA_STRAFE_RIGHT;
keyMap[3].KeyCode = KEY_RIGHT;
http://irrlicht.sourceforge.net/docu/cl ... r.html#a12

Take a look. :D


EDIT:
I just realized that I might be wasting your time here. I used this for defining keys for a FPS camera. I don't know if it'll work for other things.

Posted: Mon Jun 21, 2004 8:10 pm
by RizzleR
well its not the problem that i can't assign it
problem is if i asign a keyboard key it responds just as soon as i map
a mousekey it doesn't respond

Posted: Wed Jun 23, 2004 7:36 am
by Endar
Then its not just you. I tried with the defining for the FPS camera and the mouse button wouldn't work for that either.

Maybe there's some additional setting up that has be done for the mouse.

Posted: Fri Jun 25, 2004 12:41 pm
by Endar
Take a look at the OnEvent function or write your own. Its quite possible that the function doens't take into account a possible mouse click.

Code: Select all

   // If event is mouse input
   if( event.EventType == irr::EET_MOUSE_INPUT_EVENT){
        // If mouse cursor moved
        if(event.MouseInput.Event == irr::EMIE_LMOUSE_PRESSED_DOWN){
             return true;
        }
   }
Take a look at http://irrlicht.sourceforge.net/docu/st ... Event.html and
http://irrlicht.sourceforge.net/docu/na ... .html#a179

particularly:

Code: Select all

  
struct { 
      s32   X 
      s32   Y 
      f32   Wheel 
      EMOUSE_INPUT_EVENT   Event 
   }  MouseInput 

Posted: Sun Jun 27, 2004 9:43 am
by RizzleR
thanx endar got it to work with ur notes