]>
Commit | Line | Data |
---|---|---|
9ce192d4 | 1 | // Scintilla source code edit control |
65ec6247 RD |
2 | /** @file KeyMap.h |
3 | ** Defines a mapping between keystrokes and commands. | |
4 | **/ | |
5 | // Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org> | |
9ce192d4 RD |
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 | |
d134f170 RD |
12 | #define SCI_SHIFT SCMOD_SHIFT |
13 | #define SCI_CTRL SCMOD_CTRL | |
14 | #define SCI_ALT SCMOD_ALT | |
9ce192d4 | 15 | #define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT) |
f6bcfd97 | 16 | #define SCI_ASHIFT (SCI_ALT | SCI_SHIFT) |
9ce192d4 | 17 | |
65ec6247 RD |
18 | /** |
19 | */ | |
9ce192d4 RD |
20 | class KeyToCommand { |
21 | public: | |
22 | int key; | |
23 | int modifiers; | |
d134f170 | 24 | unsigned int msg; |
9ce192d4 RD |
25 | }; |
26 | ||
65ec6247 RD |
27 | /** |
28 | */ | |
9ce192d4 RD |
29 | class KeyMap { |
30 | KeyToCommand *kmap; | |
31 | int len; | |
32 | int alloc; | |
1a2fb4cd | 33 | static const KeyToCommand MapDefault[]; |
65ec6247 | 34 | |
9ce192d4 RD |
35 | public: |
36 | KeyMap(); | |
37 | ~KeyMap(); | |
38 | void Clear(); | |
d134f170 RD |
39 | void AssignCmdKey(int key, int modifiers, unsigned int msg); |
40 | unsigned int Find(int key, int modifiers); // 0 returned on failure | |
9ce192d4 RD |
41 | }; |
42 | ||
43 | #endif |