Loading [MathJax]/extensions/TeX/AMSmath.js
Radium Engine
1.5.20
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
f
g
i
l
m
n
o
p
q
r
s
t
v
z
Functions
a
c
d
f
g
i
l
m
n
o
p
q
r
s
t
v
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
b
d
f
i
m
s
v
w
Typedefs
a
b
c
f
g
i
k
o
r
s
t
v
Enumerations
Enumerator
Related Symbols
Files
File List
File Members
All
Macros
▼
Radium Engine
►
Radium Basics
►
Radium Concepts
►
Developer manual
►
Licenses
Todo List
Deprecated List
►
Namespaces
►
Classes
▼
Files
▼
File List
▼
src
►
Core
►
Engine
▼
Gui
►
AboutDialog
►
ParameterSetEditor
►
RadiumWindow
►
SelectionManager
►
SkeletonBasedAnimation
►
Timeline
►
TimerData
►
TransformEditor
►
TreeModel
▼
Utils
Keyboard.cpp
Keyboard.hpp
KeyMappingManager.cpp
KeyMappingManager.hpp
PickingManager.cpp
PickingManager.hpp
qt_utils.hpp
►
Viewer
►
Widgets
BaseApplication.cpp
BaseApplication.hpp
MainWindowInterface.hpp
pch.hpp
RaGui.hpp
►
Headless
►
IO
►
PluginBase
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
Keyboard.cpp
1
#include <Gui/Utils/Keyboard.hpp>
2
3
#include <map>
4
5
namespace
Ra
{
6
namespace
Gui {
7
std::map<int, bool>
g_keypresses;
8
9
// store the last key pressed, still pressed.
10
int
g_activeKey = -1;
11
12
void
keyPressed(
int
code ) {
13
g_keypresses[code] =
true
;
14
g_activeKey = code;
15
}
16
17
void
keyReleased(
int
code ) {
18
g_keypresses[code] =
false
;
19
if
( code == g_activeKey ) g_activeKey = -1;
20
}
21
22
bool
isKeyPressed(
int
code ) {
23
// Default constructed bool is false, so this should be enough
24
return
g_keypresses[code];
25
}
26
27
int
activeKey() {
28
return
g_activeKey;
29
}
30
31
void
releaseAllKeys() {
32
for
(
auto
& k : g_keypresses ) {
33
k.second =
false
;
34
}
35
g_activeKey = -1;
36
}
37
38
}
// namespace Gui
39
}
// namespace Ra
std::map
Ra
hepler function to manage enum as underlying types in VariableSet
Definition
Cage.cpp:3
src
Gui
Utils
Keyboard.cpp
Generated by
1.12.0