Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
   Copyright (c) 2017 DIVIDE-Studio
   Copyright (c) 2009 Ionut Cava

   This file is part of DIVIDE Framework.

   Permission is hereby granted, free of charge, to any person obtaining a copy
   of this software
   and associated documentation files (the "Software"), to deal in the Software
   without restriction,
   including without limitation the rights to use, copy, modify, merge, publish,
   distribute, sublicense,
   and/or sell copies of the Software, and to permit persons to whom the
   Software is furnished to do so,
   subject to the following conditions:

   The above copyright notice and this permission notice shall be included in
   all copies or substantial portions of the Software.

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   IMPLIED,
   INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
   PARTICULAR PURPOSE AND NONINFRINGEMENT.
   IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   DAMAGES OR OTHER LIABILITY,
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
   IN CONNECTION WITH THE SOFTWARE
   OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 */

#ifndef _INPUT_EVENT_HANDLER_H_
#define _INPUT_EVENT_HANDLER_H_
//'index' and 'arg' in OISJoyStick.h and 'n' in OISMultiTouch.h are unreferenced
#include "InputAggregatorInterface.h"

namespace Divide {

class Kernel;

namespace Input {

class InputInterface;
class JoystickInterface;
class EffectManager;

class EventHandler : public OIS::KeyListener,
                     public OIS::JoyStickListener,
                     public OIS::MouseListener,
                     public InputAggregatorInterface {
   protected:
    InputInterface* _pApplication;
    JoystickInterface* _pJoystickInterface;
    EffectManager* _pEffectMgr;
    InputAggregatorInterface& _eventListener;

   public:
    EventHandler(InputInterface* pApp, InputAggregatorInterface& eventListener);
    void initialize(JoystickInterface* pJoystickInterface,
                    EffectManager* pEffectMgr);

   protected:
    /// Key pressed - Engine: return true if input was consumed
    bool onKeyDown(const KeyEvent& arg);
    /// Key pressed - OIS
    bool keyPressed(const OIS::KeyEvent& arg) override;
    /// Key released - Engine: return true if input was consumed
    bool onKeyUp(const KeyEvent& arg);
    /// Key released - OIS
    bool keyReleased(const OIS::KeyEvent& arg) override;
    /// Joystick button pressed - Engine: return true if input was consumed
    bool joystickButtonPressed(const JoystickEvent& arg, JoystickButton button);
    /// Joystick button pressed - OIS
    bool buttonPressed(const OIS::JoyStickEvent& arg, JoystickButton button) override;
    /// Joystick button released - Engine: return true if input was consumed
    bool joystickButtonReleased(const JoystickEvent& arg, JoystickButton button);
    /// Joystick button released - OIS
    bool buttonReleased(const OIS::JoyStickEvent& arg, JoystickButton button) override;
    /// Joystick axis change - Engine: return true if input was consumed
    bool joystickAxisMoved(const JoystickEvent& arg, I8 axis);
    /// Joystick axis change - OIS
    bool axisMoved(const OIS::JoyStickEvent& arg, int axis) override;
    /// Joystick direction change - Engine: return true if input was consumed
    bool joystickPovMoved(const JoystickEvent& arg, I8 pov);
    /// Joystick direction change - OIS
    bool povMoved(const OIS::JoyStickEvent& arg, int pov) override;
    /// Joystick slider change - Engine: return true if input was consumed
    bool joystickSliderMoved(const JoystickEvent& arg, I8 index);
    /// Joystick slider change - OIS
    bool sliderMoved(const OIS::JoyStickEvent& arg, int index) override;
    /// Joystick 3D vector changed - Engine: return true if input was consumed
    bool joystickvector3Moved(const JoystickEvent& arg, I8 index);
    /// Joystick 3D vector changed - OIS
    bool vector3Moved(const OIS::JoyStickEvent& arg, int index) override;
    /// Mouse moved - OIS
    bool mouseMoved(const OIS::MouseEvent& arg) override;
    /// Mouse moved - Engine: return true if input was consumed
    bool mouseMoved(const MouseEvent& arg);
    /// Mouse button pressed - Engine: return true if input was consumed
    bool mouseButtonPressed(const MouseEvent& arg, MouseButton button);
    /// Mouse button pressed - OIS
    bool mousePressed(const OIS::MouseEvent& arg, OIS::MouseButtonID id) override;
    /// Mouse button released - Engine: return true if input was consumed
    bool mouseButtonReleased(const MouseEvent& arg, MouseButton button);
    /// Mouse button released - OIS
    bool mouseReleased(const OIS::MouseEvent& arg, OIS::MouseButtonID id) override;
};
};  // namespace Input
};  // namespace Divide;
#endif

Commits for Divide-Framework/trunk/Source Code/Platform/Input/Headers/EventHandler.h

Diff revisions: vs.
Revision Author Commited Message
970 Diff Diff IonutCava picture IonutCava Mon 13 Nov, 2017 17:16:44 +0000

[Ionut]
- ImWindow <-> DisplayWindow fixes

969 Diff Diff IonutCava picture IonutCava Mon 13 Nov, 2017 00:15:57 +0000

[Ionut]
- Further improve DisplayWindow <-> Input relationship
- Add Flip-Y 2D camera (D3D style projection)
- Fix IMGUI rendering
- Add IMGUI sample and IMWINDOW sample rendering at the same time
- Improve IMWINDOW multi-window support
— Bug: nothing rendering in child platform windows
- Add draw command to move render context from one window to another

952 Diff Diff IonutCava picture IonutCava Wed 25 Oct, 2017 00:35:37 +0000

[Ionut]
- Added the CEGUI rendering project to our solution for easier modification, debugging and integration
- Updated to OIS 1.4
- Some updates to the WindowHandle struct

  • Only compiled in Debug*
902 Diff Diff IonutCava picture IonutCava Sun 25 Jun, 2017 16:56:57 +0000

[Ionut]
- Rework input system a bit for easier maintenance and readability
- Toggle AntTweakBar display using CTRL+F11

836 Diff Diff IonutCava picture IonutCava Fri 27 Jan, 2017 14:59:56 +0000

[IonutCava]
- Update copyright notice

816 Diff Diff IonutCava picture IonutCava Fri 13 Jan, 2017 17:05:20 +0000

[IonutCava]
- Allow per player scene state and input source
— Add SceneStatePerPlayer class
— Add device index to InputParams objects.
— ToDo: map players to devide indices

719 Diff Diff IonutCava picture IonutCava Fri 03 Jun, 2016 16:20:08 +0000

[IonutCava]
- More SceneManager – ScenePool splitting of responsibilities
- DefaultScene will be the first scene loaded by the application. If nothing is specified in XML, it will default to "DefaultScene"

648 Diff Diff IonutCava picture IonutCava Sun 21 Feb, 2016 16:32:52 +0000

[IonutCava]
- Update copyright notice
- Move BoundingBox and BoundingSphere to a new BoundsComponent
— Add a temp hack in SceneGraphNode to update these

410 Diff Diff IonutCava picture IonutCava Fri 24 Apr, 2015 16:14:03 +0000

[Ionut]
- Added an experimental new input system (map based. Key <-> lamda to allow rebinding of keys on the fly)
— Still has some bugs: e.g. chaning cameras doesn’t work properly
- Cleaned up more hacks (e.g. shadow map pass count)
- Merged similar depth pass vertex shader code

354 IonutCava picture IonutCava Fri 20 Feb, 2015 17:17:37 +0000

[Ionut]
- Replaced GLEW with glbinding (requires a CEGUI recompile. It currently crashes)
- Replaced most “SceneGraphNode* const sgn” expressions with "SceneGraphNode& sgn"
- Replaced some pointers to kernel to references to kernel
- Fixed compilation issues with EASTL
- Removed NPOT -> POT texture conversion code. Modern GPUs handle NPOT textures perfectly fine