]> git.saurik.com Git - wxWidgets.git/blob - src/stc/scintilla/src/KeyMap.h
fd9005de84854963453484f67425a2ee0b5f1228
[wxWidgets.git] / src / stc / scintilla / src / KeyMap.h
1 // Scintilla source code edit control
2 /** @file KeyMap.h
3 ** Defines a mapping between keystrokes and commands.
4 **/
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.
7
8 #ifndef KEYTOCOMMAND_H
9 #define KEYTOCOMMAND_H
10
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
14
15 #define SCI_NORM 0
16 #define SCI_SHIFT SCMOD_SHIFT
17 #define SCI_CTRL SCMOD_CTRL
18 #define SCI_ALT SCMOD_ALT
19 #define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT)
20 #define SCI_ASHIFT (SCI_ALT | SCI_SHIFT)
21
22 /**
23 */
24 class KeyToCommand {
25 public:
26 int key;
27 int modifiers;
28 unsigned int msg;
29 };
30
31 /**
32 */
33 class KeyMap {
34 KeyToCommand *kmap;
35 int len;
36 int alloc;
37 static const KeyToCommand MapDefault[];
38
39 public:
40 KeyMap();
41 ~KeyMap();
42 void Clear();
43 void AssignCmdKey(int key, int modifiers, unsigned int msg);
44 unsigned int Find(int key, int modifiers); // 0 returned on failure
45 };
46
47 #ifdef SCI_NAMESPACE
48 }
49 #endif
50
51 #endif