1 // Scintilla source code edit control
3 ** Defines a mapping between keystrokes and commands.
5 // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
11 namespace Scintilla::Internal
{
13 #define SCI_NORM KeyMod::Norm
14 #define SCI_SHIFT KeyMod::Shift
15 #define SCI_CTRL KeyMod::Ctrl
16 #define SCI_ALT KeyMod::Alt
17 #define SCI_META KeyMod::Meta
18 #define SCI_SUPER KeyMod::Super
19 #define SCI_CSHIFT (KeyMod::Ctrl | KeyMod::Shift)
20 #define SCI_ASHIFT (KeyMod::Alt | KeyMod::Shift)
27 Scintilla::KeyMod modifiers
;
28 KeyModifiers() noexcept
: key
{}, modifiers(KeyMod::Norm
) {
30 KeyModifiers(Scintilla::Keys key_
, Scintilla::KeyMod modifiers_
) noexcept
: key(key_
), modifiers(modifiers_
) {
32 bool operator<(const KeyModifiers
&other
) const noexcept
{
34 return modifiers
< other
.modifiers
;
36 return key
< other
.key
;
45 Scintilla::KeyMod modifiers
;
46 Scintilla::Message msg
;
52 std::map
<KeyModifiers
, Scintilla::Message
> kmap
;
53 static const KeyToCommand MapDefault
[];
57 void Clear() noexcept
;
58 void AssignCmdKey(Scintilla::Keys key
, Scintilla::KeyMod modifiers
, Scintilla::Message msg
);
59 Scintilla::Message
Find(Scintilla::Keys key
, Scintilla::KeyMod modifiers
) const; // 0 returned on failure
60 const std::map
<KeyModifiers
, Scintilla::Message
> &GetKeyMap() const noexcept
;