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
KeyboardSettings(CommandController &commandController)
KeyCode
Constants that identify keys and key modifiers.
Definition: Keys.hh:26
bool getAlwaysEnableKeypad() const
Keys::KeyCode getDeadkeyHostKey(unsigned n) const
bool getAutoToggleCodeKanaLock() const
KpEnterMode getKpEnterMode() const
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
Keys::KeyCode getCodeKanaHostKey() const
MappingMode getMappingMode() const