<!-- Wanted to avoid copying .css to each folder, so copied default .css from doxyen in here, kicked out most stuff we don't need for examples and modified some a little bit.
Target was having a single html in each example folder which is created from the main.cpp files and needs no files besides some images below media folder.
<p>This tutorial builds on example 04.Movement which showed how to handle keyboard events in Irrlicht. Here we'll handle mouse events and joystick events, if you have a joystick connected and a device that supports joysticks. These are currently Windows, Linux and SDL devices. </p><divclass="fragment"><divclass="line"><spanclass="preprocessor">#ifdef _MSC_VER</span></div><divclass="line"><spanclass="comment">// We'll define this to stop MSVC complaining about sprintf().</span></div><divclass="line"><spanclass="preprocessor">#define _CRT_SECURE_NO_WARNINGS</span></div><divclass="line"><spanclass="preprocessor">#pragma comment(lib, "Irrlicht.lib")</span></div><divclass="line"><spanclass="preprocessor">#endif</span></div><divclass="line"></div><divclass="line"><spanclass="preprocessor">#include <irrlicht.h></span></div><divclass="line"><spanclass="preprocessor">#include "driverChoice.h"</span></div><divclass="line"></div><divclass="line"><spanclass="keyword">using namespace </span>irr;</div></div><!-- fragment --><p> Just as we did in example 04.Movement, we'll store the latest state of the mouse and the first joystick, updating them as we receive events. </p><divclass="fragment"><divclass="line"><spanclass="keyword">class </span>MyEventReceiver : <spanclass="keyword">public</span> IEventReceiver</div><divclass="line">{</div><divclass="line"><spanclass="keyword">public</span>:</div><divclass="line"><spanclass="comment">// We'll create a struct to record info on the mouse state</span></div><divclass="line"><spanclass="keyword">struct </span>SMouseState</div><divclass="line"> {</div><divclass="line"> core::position2di Position;</div><divclass="line"><spanclass="keywordtype">bool</span> LeftButtonDown;</div><divclass="line"> SMouseState() : LeftButtonDown(false) { }</div><divclass="line"> } MouseState;</div><divclass="line"></div><divclass="line"><spanclass="comment">// This is the one method that we have to implement</span></div><divclass="line"><spanclass="keyword">virtual</span><spanclass="keywordtype">bool</span> OnEvent(<spanclass="keyword">const</span> SEvent& event)</div><divclass="line"> {</div><divclass="line"><spanclass="comment">// Remember the mouse state</span></div><divclass="line"><spanclass="keywordflow">if</span> (event.EventType == irr::EET_MOUSE_INPUT_EVENT)</div><divclass="line"> {</div><divclass="line"><spanclass="keywordflow">switch</span>(event.MouseInput.Event)</div><divclass="line"> {</div><divclass="line"><spanclass="keywordflow">case</span> EMIE_LMOUSE_PRESSED_DOWN:</div><divclass="line"> MouseState.LeftButtonDown = <spanclass="keyword">true</span>;</div><divclass="line"><spanclass="keywordflow">break</span>;</div><divclass="line"></div><divclass="line"><spanclass="keywordflow">case</span> EMIE_LMOUSE_LEFT_UP:</div><divclass="line"> MouseState.LeftButtonDown = <spanclass="keyword">false</span>;</div><divclass="line"><spanclass="keywordflow">break</span>;</div><divclass="line"></div><divclass="line"><spanclass="keywordflow">case</span> EMIE_MOUSE_MOVED:</div><divclass="line"> MouseState.Position.X = <spanclass="keyword">event</span>.MouseInput.X;</div><divclass="line"> MouseState.Position.Y = <spanclass="keyword">event</span>.MouseInput.Y;</div><divclass="line"><spanclass="keywordflow">break</span>;</div><divclass="line"></div><divclass="line"><spanclass="keywordflow">default</span>:</div><divclass="line"><spanclass="comment">// We won't use the wheel</span></div><divclass="line"><spanclass="keywordflow">break</span>;</div><divclass="line"> }</div><divclass="line"> }</div><divclass="line"></div><divclass="line"><spanclass="comment">// The state of each connected joystick