summaryrefslogtreecommitdiff
path: root/src/joyGet.cpp
blob: f48c783a17a89695d8d069a26c896d2fed34a4cd (plain)
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
#include "FLD.hpp"

FLD::InputState
FLD::joyGet(SDL_Scancode sc) const
{
	return joystates[sc];
}

bool
FLD::joyDown(SDL_Scancode sc) const
{
	const auto state = joyGet(sc);
	return (state == InputState::Down || state == InputState::Press);
}

bool
FLD::joyUp(SDL_Scancode sc) const
{
	return !joyDown(sc);
}

bool
FLD::joyPressed(SDL_Scancode sc) const
{
	return (joyGet(sc) == InputState::Press);
}

bool
FLD::joyReleased(SDL_Scancode sc) const
{
	return (joyGet(sc) == InputState::Release);
}