openMSX
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
11namespace openmsx {
12
13class CommandController;
14
16{
17public:
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
46private:
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
bool getBoolean() const noexcept
T getEnum() const noexcept
MappingMode getMappingMode() const
KpEnterMode getKpEnterMode() const
SDL_Keycode getDeadKeyHostKey(unsigned n) const
SDL_Keycode getCodeKanaHostKey() const
This file implemented 3 utility functions:
Definition Autofire.cc:11