| 1 | /* |
|---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
|---|
| 3 | * |
|---|
| 4 | * |
|---|
| 5 | * License notice: |
|---|
| 6 | * |
|---|
| 7 | * This program is free software; you can redistribute it and/or |
|---|
| 8 | * modify it under the terms of the GNU General Public License |
|---|
| 9 | * as published by the Free Software Foundation; either version 2 |
|---|
| 10 | * of the License, or (at your option) any later version. |
|---|
| 11 | * |
|---|
| 12 | * This program is distributed in the hope that it will be useful, |
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | * GNU General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU General Public License |
|---|
| 18 | * along with this program; if not, write to the Free Software |
|---|
| 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|---|
| 20 | * |
|---|
| 21 | * Author: |
|---|
| 22 | * Reto Grieder |
|---|
| 23 | * Co-authors: |
|---|
| 24 | * ... |
|---|
| 25 | * |
|---|
| 26 | */ |
|---|
| 27 | |
|---|
| 28 | /** |
|---|
| 29 | @file |
|---|
| 30 | @brief Different implementations of input processing. |
|---|
| 31 | */ |
|---|
| 32 | |
|---|
| 33 | #ifndef _InputHandler_H__ |
|---|
| 34 | #define _InputHandler_H__ |
|---|
| 35 | |
|---|
| 36 | #include <OIS/OIS.h> |
|---|
| 37 | |
|---|
| 38 | #include "CorePrereqs.h" |
|---|
| 39 | |
|---|
| 40 | namespace orxonox |
|---|
| 41 | { |
|---|
| 42 | /** |
|---|
| 43 | @brief Captures mouse and keyboard input and distributes it to the |
|---|
| 44 | GUI. |
|---|
| 45 | */ |
|---|
| 46 | class _CoreExport InputHandlerGUI |
|---|
| 47 | : public OIS::KeyListener, public OIS::MouseListener |
|---|
| 48 | { |
|---|
| 49 | public: |
|---|
| 50 | InputHandlerGUI (); |
|---|
| 51 | ~InputHandlerGUI(); |
|---|
| 52 | |
|---|
| 53 | private: |
|---|
| 54 | // input events |
|---|
| 55 | bool mousePressed (const OIS::MouseEvent &arg, OIS::MouseButtonID id); |
|---|
| 56 | bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id); |
|---|
| 57 | bool mouseMoved (const OIS::MouseEvent &arg); |
|---|
| 58 | bool keyPressed (const OIS::KeyEvent &arg); |
|---|
| 59 | bool keyReleased (const OIS::KeyEvent &arg); |
|---|
| 60 | }; |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | /** |
|---|
| 64 | @brief Captures mouse and keyboard input while in the actual game mode. |
|---|
| 65 | Manages the key bindings. |
|---|
| 66 | */ |
|---|
| 67 | class _CoreExport InputHandlerGame |
|---|
| 68 | : public OIS::KeyListener, public OIS::MouseListener |
|---|
| 69 | { |
|---|
| 70 | public: |
|---|
| 71 | InputHandlerGame (); |
|---|
| 72 | ~InputHandlerGame(); |
|---|
| 73 | |
|---|
| 74 | private: |
|---|
| 75 | // input events |
|---|
| 76 | bool mousePressed (const OIS::MouseEvent &arg, OIS::MouseButtonID id); |
|---|
| 77 | bool mouseReleased(const OIS::MouseEvent &arg, OIS::MouseButtonID id); |
|---|
| 78 | bool mouseMoved (const OIS::MouseEvent &arg); |
|---|
| 79 | bool keyPressed (const OIS::KeyEvent &arg); |
|---|
| 80 | bool keyReleased (const OIS::KeyEvent &arg); |
|---|
| 81 | }; |
|---|
| 82 | |
|---|
| 83 | } |
|---|
| 84 | |
|---|
| 85 | #endif /* _InputHandler_H__ */ |
|---|