]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/stc/scintilla/src/KeyMap.h
Cast to void* before casting to Node** to make the compiler do no strict-aliasing...
[wxWidgets.git] / contrib / 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 #define SCI_NORM 0
12 #define SCI_SHIFT SCMOD_SHIFT
13 #define SCI_CTRL SCMOD_CTRL
14 #define SCI_ALT SCMOD_ALT
15 #define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT)
16 #define SCI_ASHIFT (SCI_ALT | SCI_SHIFT)
17
18 /**
19 */
20 class KeyToCommand {
21 public:
22 int key;
23 int modifiers;
24 unsigned int msg;
25 };
26
27 /**
28 */
29 class KeyMap {
30 KeyToCommand *kmap;
31 int len;
32 int alloc;
33 static const KeyToCommand MapDefault[];
34
35 public:
36 KeyMap();
37 ~KeyMap();
38 void Clear();
39 void AssignCmdKey(int key, int modifiers, unsigned int msg);
40 unsigned int Find(int key, int modifiers); // 0 returned on failure
41 };
42
43 #endif