-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPicoInput.cpp
More file actions
46 lines (39 loc) · 762 Bytes
/
PicoInput.cpp
File metadata and controls
46 lines (39 loc) · 762 Bytes
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
#include "PicoInput.h"
void PicoInput::initialize()
{
_GLOBAL_inputState.initialize();
ShowCursor(true);
_dmposX = 0.0;
_dmposY = 0.0;
_dmWheel = 0.0;
for(int i = 0; i < PICO_NKEYS; ++i)
{
_keyState[i] = 0;
_keyStatePrev[i] = 0;
}
}
void PicoInput::update(PicoInputState* xinputState)
{
_dmposX = xinputState->_mousePosXDelta;
_dmposY = xinputState->_mousePosYDelta;
_dmWheel = xinputState->_mouseWheelDelta;
if(xinputState->_keyboardStateHasChanged)
{
for(int i = 0; i < PICO_NKEYS; ++i)
{
_keyStatePrev[i] = _keyState[i];
_keyState[i] = xinputState->_keyboardState[i];
}
}
else
{
for(int i = 0; i < PICO_NKEYS; ++i)
{
_keyStatePrev[i] = _keyState[i];
}
}
xinputState->reset();
}
void PicoInput::release()
{
}