PDA

View Full Version : adding FPS Key and mouse controls to RT3DApp



BigBMan
11-11-2010, 05:56 AM
So, wondering what you think the best route would be for including keyboard (w,a,s,d, space...) and mouse controls to the windows version of RT3DApp. It doesn't seem to be included.

Seth
11-11-2010, 06:26 AM
For the WASD, I'm sort of in the middle of adding support for that now - it will give you pressed and released messages through a new sig, that's really all you need for keyboard controls.

(for Win, I will use WM_KEYDOWN and WM_KEYUP to get the info I guess.. not implemented yet)

For the Windows mouse - uhh.. hmm. Mouse movement is being sent using message type MESSAGE_TYPE_GUI_CLICK_MOVE_RAW through m_sig_input (or m_sig_input_move if INPUT_MODE_SEPARATE_MOVE_TOUCHES was set using BaseApp::SetInputMode) Check shared/win/app/main.cpp and search for WM_MOUSEMOVE to see where that happens.

You could capture that and see if that input works ok, from there you would have to figure out how you wanted to adjust the Irrlicht camera/player position based on it.

If you need to get "serious" like for a Windows FPS, it would probably be better to make a InputDirectInputComponent.cpp and use DirectX to do the heavy lifting so you can access all the extra buttons and such. Probably need it for gamepad support as well.

BigBMan
11-11-2010, 06:49 AM
Cool, I'll check that out. I'm just looking to emulate FPS touches with the keyboard/mouse. I've tapped, touched, swatted and punched my screen (as many developers tend to do) but that doesn't seem to help ;)