openMSX
input
KeyboardSettings.hh
Go to the documentation of this file.
1
#ifndef KEYBOARDSETTINGS_HH
2
#define KEYBOARDSETTINGS_HH
3
4
#include "
SDLKey.hh
"
5
#include "
EnumSetting.hh
"
6
#include "
BooleanSetting.hh
"
7
8
#include <array>
9
#include <cassert>
10
11
namespace
openmsx
{
12
13
class
CommandController;
14
15
class
KeyboardSettings
16
{
17
public
:
18
enum class
KpEnterMode
{
MSX_KP_COMMA
,
MSX_ENTER
};
19
enum class
MappingMode
{
KEY
,
CHARACTER
,
POSITIONAL
};
20
21
explicit
KeyboardSettings
(
CommandController
& commandController);
22
23
[[nodiscard]] SDL_Keycode
getDeadKeyHostKey
(
unsigned
n)
const
{
24
assert(n < 3);
25
return
deadKeyHostKey[n].getEnum();
26
}
27
[[nodiscard]] SDL_Keycode
getCodeKanaHostKey
()
const
{
28
return
codeKanaHostKey.
getEnum
();
29
}
30
[[nodiscard]]
KpEnterMode
getKpEnterMode
()
const
{
31
return
kpEnterMode.
getEnum
();
32
}
33
[[nodiscard]]
MappingMode
getMappingMode
()
const
{
34
return
mappingMode.
getEnum
();
35
}
36
[[nodiscard]]
bool
getAlwaysEnableKeypad
()
const
{
37
return
alwaysEnableKeypad.
getBoolean
();
38
}
39
[[nodiscard]]
bool
getTraceKeyPresses
()
const
{
40
return
traceKeyPresses.
getBoolean
();
41
}
42
[[nodiscard]]
bool
getAutoToggleCodeKanaLock
()
const
{
43
return
autoToggleCodeKanaLock.
getBoolean
();
44
}
45
46
private
:
47
std::array<EnumSetting<SDL_Keycode>, 3> deadKeyHostKey;
48
EnumSetting<SDL_Keycode>
codeKanaHostKey;
49
EnumSetting<KpEnterMode>
kpEnterMode;
50
EnumSetting<MappingMode>
mappingMode;
51
BooleanSetting
alwaysEnableKeypad;
52
BooleanSetting
traceKeyPresses;
53
BooleanSetting
autoToggleCodeKanaLock;
54
};
55
56
}
// namespace openmsx
57
58
#endif
BooleanSetting.hh
EnumSetting.hh
SDLKey.hh
openmsx::BooleanSetting
Definition
BooleanSetting.hh:9
openmsx::BooleanSetting::getBoolean
bool getBoolean() const noexcept
Definition
BooleanSetting.hh:17
openmsx::CommandController
Definition
CommandController.hh:19
openmsx::EnumSetting
Definition
EnumSetting.hh:54
openmsx::EnumSetting::getEnum
T getEnum() const noexcept
Definition
EnumSetting.hh:112
openmsx::KeyboardSettings
Definition
KeyboardSettings.hh:16
openmsx::KeyboardSettings::getAlwaysEnableKeypad
bool getAlwaysEnableKeypad() const
Definition
KeyboardSettings.hh:36
openmsx::KeyboardSettings::MappingMode
MappingMode
Definition
KeyboardSettings.hh:19
openmsx::KeyboardSettings::MappingMode::POSITIONAL
@ POSITIONAL
openmsx::KeyboardSettings::MappingMode::KEY
@ KEY
openmsx::KeyboardSettings::MappingMode::CHARACTER
@ CHARACTER
openmsx::KeyboardSettings::getTraceKeyPresses
bool getTraceKeyPresses() const
Definition
KeyboardSettings.hh:39
openmsx::KeyboardSettings::getMappingMode
MappingMode getMappingMode() const
Definition
KeyboardSettings.hh:33
openmsx::KeyboardSettings::getKpEnterMode
KpEnterMode getKpEnterMode() const
Definition
KeyboardSettings.hh:30
openmsx::KeyboardSettings::getAutoToggleCodeKanaLock
bool getAutoToggleCodeKanaLock() const
Definition
KeyboardSettings.hh:42
openmsx::KeyboardSettings::KpEnterMode
KpEnterMode
Definition
KeyboardSettings.hh:18
openmsx::KeyboardSettings::KpEnterMode::MSX_ENTER
@ MSX_ENTER
openmsx::KeyboardSettings::KpEnterMode::MSX_KP_COMMA
@ MSX_KP_COMMA
openmsx::KeyboardSettings::getDeadKeyHostKey
SDL_Keycode getDeadKeyHostKey(unsigned n) const
Definition
KeyboardSettings.hh:23
openmsx::KeyboardSettings::getCodeKanaHostKey
SDL_Keycode getCodeKanaHostKey() const
Definition
KeyboardSettings.hh:27
openmsx
This file implemented 3 utility functions:
Definition
Autofire.cc:11
Generated on Sun Dec 1 2024 22:13:42 for openMSX by
1.9.8