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
#include "Headers/SceneInputActions.h"

namespace Divide {

PressReleaseActions::PressReleaseActions()
    : PressReleaseActions(0u, 0u)
{
}

PressReleaseActions::PressReleaseActions(U16 onPressAction,
                                         U16 onReleaseAction)
    : PressReleaseActions(onPressAction, onReleaseAction, 0u, 0u)
{
}

PressReleaseActions::PressReleaseActions(U16 onPressAction,
                                         U16 onReleaseAction,
                                         U16 onLCtrlPressAction,
                                         U16 onLCtrlReleaseAction,
                                         U16 onRCtrlPressAction,
                                         U16 onRCtrlReleaseAction,
                                         U16 onLAltPressAction,
                                         U16 onLAltReleaseAction,
                                         U16 onRAltPressAction,
                                         U16 onRAltReleaseAction)
    : _onPressAction(onPressAction),
      _onReleaseAction(onReleaseAction),
      _onLCtrlPressAction(onLCtrlPressAction),
      _onLCtrlReleaseAction(onLCtrlReleaseAction),
      _onRCtrlPressAction(onRCtrlPressAction),
      _onRCtrlReleaseAction(onRCtrlReleaseAction),
      _onLAltPressAction(onLAltPressAction),
      _onLAltReleaseAction(onLAltReleaseAction),
      _onRAltPressAction(onRAltPressAction),
      _onRAltReleaseAction(onRAltReleaseAction)
{
}

InputAction::InputAction()
{
}

InputAction::InputAction(DELEGATE_CBK<void, InputParams>& action)
    : _action(action)
{
}

void InputAction::displayName(const stringImpl& name) {
    _displayName = name;
}

InputActionList::InputActionList()
{
    _noOPAction.displayName("no-op");
}

bool InputActionList::registerInputAction(U16 id, DELEGATE_CBK<void, InputParams> action) {
    if (_inputActions.find(id) == std::cend(_inputActions)) {
        hashAlg::emplace(_inputActions, id, InputAction(action));
        return true;
    }

    return false;
}

InputAction& InputActionList::getInputAction(U16 id) {
    hashMapImpl<U16, InputAction>::iterator it;
    it = _inputActions.find(id);

    if (it != std::cend(_inputActions)) {
        return it->second;
    }

    return _noOPAction;
}

const InputAction& InputActionList::getInputAction(U16 id) const {
    hashMapImpl<U16, InputAction>::const_iterator it;
    it = _inputActions.find(id);

    if (it != std::cend(_inputActions)) {
        return it->second;
    }

    return _noOPAction;
}

}; //namespace Divide

Commits for Divide-Framework/trunk/Source Code/Scenes/SceneInputActions.cpp

Diff revisions: vs.
Revision Author Commited Message
842 Diff Diff IonutCava picture IonutCava Wed 01 Feb, 2017 17:25:15 +0000

[IonutCava]
- Start to implement scripting support via ChaiScript: http://chaiscript.com/
- Cleanup DELEGATE_CBK alias

703 Diff Diff IonutCava picture IonutCava Wed 11 May, 2016 15:44:57 +0000

[IonutCava]
- Finish XML-based control bindings:
— Allow per bind input params (key id, mouse button index, joystick control data, etc)
— Allow mouse binding (with up to 7 buttons)
— Allow up to 4 joysticks (for now) with 120+ button, POV, Axis, Slider and Vector binding support for each
- Change all hashes in code from U32 to size_t for compatibility with STL/Boost

700 Diff Diff IonutCava picture IonutCava Tue 10 May, 2016 22:13:05 +0000

[IonutCava]
- More work on rebindable keys:
— Key events loaded from XML finished
— Mouse and Joystick control binding from XML still not finished

699 IonutCava picture IonutCava Tue 10 May, 2016 16:16:57 +0000

[IonutCava]
- Initial key binding code with external XML support
— Allow separation of actions and keys
— Specify actions in code by id
— Specify action id for each Key state
— Allow key modifiers: Left/Right Alt, Left/Right Ctrl

- Initial default scene code