openMSX
KeyboardSettings.hh
Go to the documentation of this file.
1 #ifndef KEYBOARDSETTINGS_HH
2 #define KEYBOARDSETTINGS_HH
3 
4 #include "Keys.hh"
5 #include "EnumSetting.hh"
6 #include "BooleanSetting.hh"
7 #include <memory>
8 #include <cassert>
9 
10 namespace openmsx {
11 
12 class CommandController;
13 
15 {
16 public:
19 
20  explicit KeyboardSettings(CommandController& commandController);
21 
22  Keys::KeyCode getDeadkeyHostKey(unsigned n) const {
23  assert(n < 3);
24  return deadkeyHostKey[n]->getEnum();
25  }
27  return codeKanaHostKey.getEnum();
28  }
30  return kpEnterMode.getEnum();
31  }
33  return mappingMode.getEnum();
34  }
35  bool getAlwaysEnableKeypad() const {
36  return alwaysEnableKeypad.getBoolean();
37  }
38  bool getTraceKeyPresses() const {
39  return traceKeyPresses.getBoolean();
40  }
42  return autoToggleCodeKanaLock.getBoolean();
43  }
44 
45 private:
46  std::unique_ptr<EnumSetting<Keys::KeyCode>> deadkeyHostKey[3];
47  EnumSetting<Keys::KeyCode> codeKanaHostKey;
48  EnumSetting<KpEnterMode> kpEnterMode;
49  EnumSetting<MappingMode> mappingMode;
50  BooleanSetting alwaysEnableKeypad;
51  BooleanSetting traceKeyPresses;
52  BooleanSetting autoToggleCodeKanaLock;
53 };
54 
55 } // namespace openmsx
56 
57 #endif
openmsx::EnumSetting< Keys::KeyCode >
openmsx::KeyboardSettings::MSX_ENTER
Definition: KeyboardSettings.hh:17
openmsx::KeyboardSettings::getAlwaysEnableKeypad
bool getAlwaysEnableKeypad() const
Definition: KeyboardSettings.hh:35
openmsx::CommandController
Definition: CommandController.hh:17
openmsx::KeyboardSettings::getMappingMode
MappingMode getMappingMode() const
Definition: KeyboardSettings.hh:32
openmsx::EnumSetting::getEnum
T getEnum() const noexcept
Definition: EnumSetting.hh:92
openmsx::KeyboardSettings::KeyboardSettings
KeyboardSettings(CommandController &commandController)
Definition: KeyboardSettings.cc:26
BooleanSetting.hh
openmsx::KeyboardSettings::getDeadkeyHostKey
Keys::KeyCode getDeadkeyHostKey(unsigned n) const
Definition: KeyboardSettings.hh:22
openmsx::KeyboardSettings::KpEnterMode
KpEnterMode
Definition: KeyboardSettings.hh:17
openmsx::KeyboardSettings
Definition: KeyboardSettings.hh:14
openmsx::KeyboardSettings::getKpEnterMode
KpEnterMode getKpEnterMode() const
Definition: KeyboardSettings.hh:29
openmsx::KeyboardSettings::CHARACTER_MAPPING
Definition: KeyboardSettings.hh:18
Keys.hh
EnumSetting.hh
openmsx::KeyboardSettings::getAutoToggleCodeKanaLock
bool getAutoToggleCodeKanaLock() const
Definition: KeyboardSettings.hh:41
openmsx::KeyboardSettings::getTraceKeyPresses
bool getTraceKeyPresses() const
Definition: KeyboardSettings.hh:38
openmsx::BooleanSetting
Definition: BooleanSetting.hh:8
openmsx::KeyboardSettings::KEY_MAPPING
Definition: KeyboardSettings.hh:18
openmsx::KeyboardSettings::getCodeKanaHostKey
Keys::KeyCode getCodeKanaHostKey() const
Definition: KeyboardSettings.hh:26
openmsx::Keys::KeyCode
KeyCode
Constants that identify keys and key modifiers.
Definition: Keys.hh:25
openmsx::KeyboardSettings::MappingMode
MappingMode
Definition: KeyboardSettings.hh:18
openmsx::KeyboardSettings::MSX_KP_COMMA
Definition: KeyboardSettings.hh:17
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::BooleanSetting::getBoolean
bool getBoolean() const noexcept
Definition: BooleanSetting.hh:17