summaryrefslogtreecommitdiffstats
path: root/src/KeyMap.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/KeyMap.h')
-rwxr-xr-xsrc/KeyMap.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/KeyMap.h b/src/KeyMap.h
new file mode 100755
index 0000000..364df68
--- /dev/null
+++ b/src/KeyMap.h
@@ -0,0 +1,43 @@
+// Scintilla source code edit control
+/** @file KeyMap.h
+ ** Defines a mapping between keystrokes and commands.
+ **/
+// Copyright 1998-2001 by Neil Hodgson <neilh@scintilla.org>
+// The License.txt file describes the conditions under which this software may be distributed.
+
+#ifndef KEYTOCOMMAND_H
+#define KEYTOCOMMAND_H
+
+#define SCI_NORM 0
+#define SCI_SHIFT SCMOD_SHIFT
+#define SCI_CTRL SCMOD_CTRL
+#define SCI_ALT SCMOD_ALT
+#define SCI_CSHIFT (SCI_CTRL | SCI_SHIFT)
+#define SCI_ASHIFT (SCI_ALT | SCI_SHIFT)
+
+/**
+ */
+class KeyToCommand {
+public:
+ int key;
+ int modifiers;
+ unsigned int msg;
+};
+
+/**
+ */
+class KeyMap {
+ KeyToCommand *kmap;
+ int len;
+ int alloc;
+ static const KeyToCommand MapDefault[];
+
+public:
+ KeyMap();
+ ~KeyMap();
+ void Clear();
+ void AssignCmdKey(int key, int modifiers, unsigned int msg);
+ unsigned int Find(int key, int modifiers); // 0 returned on failure
+};
+
+#endif