summaryrefslogtreecommitdiff
path: root/command.h
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-12-29 23:02:42 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-12-29 23:02:42 -0500
commit642b09558e586d47f172fcfd18c296d400317708 (patch)
tree796666be6c3721a3c70dad66bd94c902b297e8ab /command.h
parent51837743b0f90973bf63582a8f34662e9677629e (diff)
started config file
Diffstat (limited to 'command.h')
-rw-r--r--command.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/command.h b/command.h
new file mode 100644
index 0000000..d4df03a
--- /dev/null
+++ b/command.h
@@ -0,0 +1,71 @@
+ENUM_U16 {
+ CMD_UNKNOWN,
+ CMD_NOOP,
+ // movement commands
+ CMD_LEFT,
+ CMD_RIGHT,
+ CMD_UP,
+ CMD_DOWN,
+ CMD_SELECT_LEFT,
+ CMD_SELECT_RIGHT,
+ CMD_SELECT_UP,
+ CMD_SELECT_DOWN,
+ CMD_LEFT_WORD,
+ CMD_RIGHT_WORD,
+ CMD_SELECT_LEFT_WORD,
+ CMD_SELECT_RIGHT_WORD,
+ CMD_START_OF_LINE,
+ CMD_END_OF_LINE,
+ CMD_SELECT_START_OF_LINE,
+ CMD_SELECT_END_OF_LINE,
+ CMD_START_OF_FILE,
+ CMD_END_OF_FILE,
+ CMD_SELECT_START_OF_FILE,
+ CMD_SELECT_END_OF_FILE,
+
+ // deletion
+ CMD_BACKSPACE,
+ CMD_DELETE,
+ CMD_BACKSPACE_WORDS,
+ CMD_DELETE_WORDS,
+
+ CMD_SAVE,
+
+ CMD_COUNT
+} ENUM_U16_END(Command);
+
+typedef struct {
+ char const *name;
+ Command cmd;
+} CommandName;
+
+static CommandName const command_names[CMD_COUNT] = {
+ {"unknown", CMD_UNKNOWN},
+ {"noop", CMD_NOOP},
+ {"left", CMD_LEFT},
+ {"right", CMD_RIGHT},
+ {"up", CMD_UP},
+ {"down", CMD_DOWN},
+ {"select-left", CMD_SELECT_LEFT},
+ {"select-right", CMD_SELECT_RIGHT},
+ {"select-up", CMD_SELECT_UP},
+ {"select-down", CMD_SELECT_DOWN},
+ {"left-word", CMD_LEFT_WORD},
+ {"right-word", CMD_RIGHT_WORD},
+ {"select-left-word", CMD_SELECT_LEFT_WORD},
+ {"select-right-word", CMD_SELECT_RIGHT_WORD},
+ {"start-of-line", CMD_START_OF_LINE},
+ {"end-of-line", CMD_END_OF_LINE},
+ {"select-start-of-line", CMD_SELECT_START_OF_LINE},
+ {"select-end-of-line", CMD_SELECT_END_OF_LINE},
+ {"start-of-file", CMD_START_OF_FILE},
+ {"end-of-file", CMD_END_OF_FILE},
+ {"select-start-of-file", CMD_SELECT_START_OF_FILE},
+ {"select-end-of-file", CMD_SELECT_END_OF_FILE},
+ {"backspace", CMD_BACKSPACE},
+ {"delete", CMD_DELETE},
+ {"backspace-words", CMD_BACKSPACE},
+ {"delete-words", CMD_DELETE},
+ {"save", CMD_SAVE}
+};
+