Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
CEGUIInput.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2018 DIVIDE-Studio
3 Copyright (c) 2009 Ionut Cava
4
5 This file is part of DIVIDE Framework.
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software
9 and associated documentation files (the "Software"), to deal in the Software
10 without restriction,
11 including without limitation the rights to use, copy, modify, merge, publish,
12 distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so,
15 subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 IMPLIED,
22 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
23 PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
25 DAMAGES OR OTHER LIABILITY,
26 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
27 IN CONNECTION WITH THE SOFTWARE
28 OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29
30 */
31
32#pragma once
33#ifndef DVD_CEGUI_INPUT_H_
34#define DVD_CEGUI_INPUT_H_
35
38
39namespace Divide {
40
41class GUI;
42struct Configuration;
43
47 public:
48 explicit CEGUIInput(GUI& parent) noexcept;
49 void init(const Configuration& config) noexcept;
50
52 bool onKeyDown(const Input::KeyEvent& key) override;
54 bool onKeyUp(const Input::KeyEvent& key) override;
56 bool joystickAxisMoved(const Input::JoystickEvent& arg) override;
58 bool joystickPovMoved(const Input::JoystickEvent& arg) override;
60 bool joystickButtonPressed(const Input::JoystickEvent& arg) override;
62 bool joystickButtonReleased(const Input::JoystickEvent& arg) override;
63 bool joystickBallMoved(const Input::JoystickEvent& arg) override;
64 bool joystickAddRemove(const Input::JoystickEvent& arg) override;
65 bool joystickRemap(const Input::JoystickEvent &arg) override;
67 bool mouseMoved(const Input::MouseMoveEvent& arg) override;
69 bool mouseButtonPressed(const Input::MouseButtonEvent& arg) override;
71 bool mouseButtonReleased(const Input::MouseButtonEvent& arg) override;
72
73 bool onTextEvent(const Input::TextEvent& arg) override;
74
75 protected:
77 bool _enabled{ false };
79 bool injectKey(bool pressed, const Input::KeyEvent& evt);
80 void repeatKey(const Input::KeyEvent& evt) override;
81};
82
83}; // namespace Divide
84
85#endif //DVD_CEGUI_INPUT_H_
This class defines AutoRepeatKey::repeatKey(...) as CEGUI key inputs.
Definition: CEGUIInput.h:46
bool joystickButtonPressed(const Input::JoystickEvent &arg) override
Joystick button pressed: return true if input was consumed.
Definition: CEGUIInput.cpp:355
bool joystickRemap(const Input::JoystickEvent &arg) override
Definition: CEGUIInput.cpp:386
bool mouseButtonReleased(const Input::MouseButtonEvent &arg) override
Mouse button released: return true if input was consumed.
Definition: CEGUIInput.cpp:296
void repeatKey(const Input::KeyEvent &evt) override
Override this to define custom events for key repeats.
Definition: CEGUIInput.cpp:214
bool joystickButtonReleased(const Input::JoystickEvent &arg) override
Joystick button released: return true if input was consumed.
Definition: CEGUIInput.cpp:363
bool joystickPovMoved(const Input::JoystickEvent &arg) override
Joystick direction change: return true if input was consumed.
Definition: CEGUIInput.cpp:347
bool onKeyUp(const Input::KeyEvent &key) override
Key released: return true if input was consumed.
Definition: CEGUIInput.cpp:233
bool joystickBallMoved(const Input::JoystickEvent &arg) override
Definition: CEGUIInput.cpp:371
bool onKeyDown(const Input::KeyEvent &key) override
Key pressed: return true if input was consumed.
Definition: CEGUIInput.cpp:227
void init(const Configuration &config) noexcept
Definition: CEGUIInput.cpp:178
bool mouseButtonPressed(const Input::MouseButtonEvent &arg) override
Mouse button pressed: return true if input was consumed.
Definition: CEGUIInput.cpp:255
bool joystickAxisMoved(const Input::JoystickEvent &arg) override
Joystick axis change: return true if input was consumed.
Definition: CEGUIInput.cpp:339
bool injectKey(bool pressed, const Input::KeyEvent &evt)
Called on key events: return true if the input was consumed.
Definition: CEGUIInput.cpp:184
bool joystickAddRemove(const Input::JoystickEvent &arg) override
Definition: CEGUIInput.cpp:379
bool mouseMoved(const Input::MouseMoveEvent &arg) override
Mouse moved: return true if input was consumed.
Definition: CEGUIInput.cpp:239
bool onTextEvent(const Input::TextEvent &arg) override
Definition: CEGUIInput.cpp:393
Graphical User Interface.
Definition: GUI.h:81
Handle console commands that start with a forward slash.
Definition: AIProcessor.cpp:7
Project & parent
Definition: DefaultScene.h:41