1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
|
enum key_mode {
key_mode_all,
key_mode_viewport,
key_mode_timeline,
key_mode_graph,
key_mode_brush,
key_mode_count,
};
enum key_mods {
Mod_None,
Mod_Ctrl,
Mod_Alt,
Mod_Shift,
Mod_CtrlShift
};
struct shortcut_entry {
ImGuiKey_ Key;
key_mods Mods;
key_mode Mode;
char *Name;
};
static shortcut_entry ShortcutArray[] {
{ ImGuiKey_None, Mod_None, key_mode_all, "Many actions/modes are escapable with the Esc key." },
{ ImGuiKey_None, Mod_None, key_mode_all, "Undo isn't fully implemented yet; beware crashes." },
{ ImGuiKey_Q, Mod_None, key_mode_all, "Quit (instantly!)" },
{ ImGuiKey_W, Mod_None, key_mode_all, "Step back one frame" },
{ ImGuiKey_E, Mod_None, key_mode_all, "Step forward one frame" },
{ ImGuiKey_V, Mod_None, key_mode_all, "Move tool" },
{ ImGuiKey_B, Mod_None, key_mode_all, "Brush tool" },
{ ImGuiKey_D, Mod_None, key_mode_all, "Pen tool" },
{ ImGuiKey_Space, Mod_None, key_mode_all, "Play scene" },
{ ImGuiKey_Delete, Mod_None, key_mode_all, "Delete selection (WIP)" },
{ ImGuiKey_S, Mod_Ctrl, key_mode_all, "Save" },
{ ImGuiKey_S, Mod_CtrlShift, key_mode_all, "Save as" },
{ ImGuiKey_C, Mod_Ctrl, key_mode_all, "Copy" },
{ ImGuiKey_P, Mod_Ctrl, key_mode_all, "Paste" },
{ ImGuiKey_Z, Mod_Ctrl, key_mode_all, "Undo" },
{ ImGuiKey_Z, Mod_Ctrl, key_mode_all, "Redo" },
{ ImGuiKey_Space, Mod_Shift, key_mode_all, "Focus effects search" },
{ ImGuiKey_Slash, Mod_Shift, key_mode_all, "Open help" },
{ ImGuiKey_None, Mod_None, key_mode_viewport, "Hold right click to pan." },
{ ImGuiKey_None, Mod_None, key_mode_viewport, "Hold Z and drag left click to zoom." },
{ ImGuiKey_None, Mod_None, key_mode_viewport, "Press Enter or ctrl+click to commit a transform." },
{ ImGuiKey_None, Mod_None, key_mode_viewport, "Hold alt while dragging a layer to duplicate it." },
{ ImGuiKey_T, Mod_None, key_mode_viewport, "Transform selected layers" },
{ ImGuiKey_D, Mod_None, key_mode_viewport, "Stepped duplicate" },
{ ImGuiKey_X, Mod_Shift, key_mode_viewport, "Swap stroke/fill colors of selected shape layers" },
{ ImGuiKey_Tab, Mod_None, key_mode_timeline, "Switch between timeline and graph" },
{ ImGuiKey_2, Mod_None, key_mode_timeline, "Toggle precomp view" },
{ ImGuiKey_G, Mod_None, key_mode_timeline, "Toggle position keyframes" },
{ ImGuiKey_A, Mod_None, key_mode_timeline, "Toggle anchor point keyframes" },
{ ImGuiKey_R, Mod_None, key_mode_timeline, "Toggle roation keyframes" },
{ ImGuiKey_S, Mod_None, key_mode_timeline, "Toggle scale keyframes" },
{ ImGuiKey_T, Mod_None, key_mode_timeline, "Toggle time remapping keyframes" },
{ ImGuiKey_T, Mod_Shift, key_mode_timeline, "Toggle opacity keyframes" },
{ ImGuiKey_U, Mod_None, key_mode_timeline, "Toggle all active channels" },
{ ImGuiKey_N, Mod_None, key_mode_timeline, "Mark frame start" },
{ ImGuiKey_N, Mod_Shift, key_mode_timeline, "Mark frame end" },
{ ImGuiKey_G, Mod_None, key_mode_graph, "Enter keyframe moving mode" },
{ ImGuiKey_X, Mod_None, key_mode_graph, "Constrain to X axis" },
{ ImGuiKey_Y, Mod_None, key_mode_graph, "Constrain to Y axis" },
{ ImGuiKey_None, Mod_None, key_mode_brush, "Hold alt and drag to adjust size/hardness." },
{ ImGuiKey_X, Mod_None, key_mode_brush, "Swap FG and BG colors" },
};
struct key_entry {
ImGuiKey_ KeyIndex;
char *Name;
char *ShiftName;
uint32 Sector;
ImVec2 Offset;
real32 WidthRatio;
};
// dumb typing exercise
static key_entry KeyEntries[] {
{ ImGuiKey_Tab, "Tab", "\0", 0, ImVec2(0, 1), 1.5f },
{ ImGuiKey_LeftArrow, "<-", "\0", 2, ImVec2(0, 4), 1.0f },
{ ImGuiKey_RightArrow, "->", "", 2, ImVec2(2, 4), 1.0f },
{ ImGuiKey_UpArrow, "/\\", "", 2, ImVec2(1, 3), 1.0f },
{ ImGuiKey_DownArrow, "\\/", "", 2, ImVec2(1, 4), 1.0f },
{ ImGuiKey_PageUp, "Up", "", 2, ImVec2(2, 0), 1.0f },
{ ImGuiKey_PageDown, "Dn", "", 2, ImVec2(2, 1), 1.0f },
{ ImGuiKey_Home, "Home", "", 2, ImVec2(1, 0), 1.0f },
{ ImGuiKey_End, "End", "", 2, ImVec2(1, 1), 1.0f },
{ ImGuiKey_Insert, "Insert", "", 2, ImVec2(0, 0), 1.0f },
{ ImGuiKey_Delete, "Delete", "", 2, ImVec2(0, 1), 1.0f },
{ ImGuiKey_Backspace, "Backspace", "", 0, ImVec2(13, 0), 2.0f },
{ ImGuiKey_Space, "Space", "", 0, ImVec2(3.75, 4), 6.5f },
{ ImGuiKey_Enter, "Enter", "", 0, ImVec2(12, 2), 2.25f},
{ ImGuiKey_Escape, "Esc", "", 1, ImVec2(0, 0), 1.0f },
{ ImGuiKey_LeftCtrl, "Ctrl", "", 0, ImVec2(0, 4), 1.25f },
{ ImGuiKey_LeftShift, "Shift", "", 0, ImVec2(0, 3), 2.5f },
{ ImGuiKey_LeftAlt, "Alt", "", 0, ImVec2(1.25, 4), 1.25 },
{ ImGuiKey_LeftSuper, "Sp", "", 0, ImVec2(2.5, 4), 1.25f },
{ ImGuiKey_RightCtrl, "Ctrl", "", 0, ImVec2(13.75, 4), 1.25f },
{ ImGuiKey_RightShift, "Shift", "", 0, ImVec2(11, 3), 2.5f },
{ ImGuiKey_RightAlt, "Alt", "", 0, ImVec2(11.25, 4), 1.25 },
{ ImGuiKey_RightSuper, "Sp", "", 0, ImVec2(10.25, 4), 1.0f },
{ ImGuiKey_Menu, "Menu", "", 0, ImVec2(12.5, 4), 1.25 },
{ ImGuiKey_0, "0", ")", 0, ImVec2(10, 0), 1.0f },
{ ImGuiKey_1, "1", "!", 0, ImVec2(1, 0), 1.0f },
{ ImGuiKey_2, "2", "@", 0, ImVec2(2, 0), 1.0f },
{ ImGuiKey_3, "3", "$", 0, ImVec2(3, 0), 1.0f },
{ ImGuiKey_4, "4", "%", 0, ImVec2(4, 0), 1.0f },
{ ImGuiKey_5, "5", "%", 0, ImVec2(5, 0), 1.0f },
{ ImGuiKey_6, "6", "^", 0, ImVec2(6, 0), 1.0f },
{ ImGuiKey_7, "7", "&", 0, ImVec2(7, 0), 1.0f },
{ ImGuiKey_8, "8", "*", 0, ImVec2(8, 0), 1.0f },
{ ImGuiKey_9, "9", "(", 0, ImVec2(9, 0), 1.0f },
{ ImGuiKey_A, "a", "A", 0, ImVec2(1, 2), 1.0f },
{ ImGuiKey_B, "b", "B", 0, ImVec2(5, 3), 1.0f },
{ ImGuiKey_C, "c", "C", 0, ImVec2(3, 3), 1.0f },
{ ImGuiKey_D, "d", "D", 0, ImVec2(3, 2), 1.0f },
{ ImGuiKey_E, "e", "E", 0, ImVec2(3, 1), 1.0f },
{ ImGuiKey_F, "f", "F", 0, ImVec2(4, 2), 1.0f },
{ ImGuiKey_G, "g", "G", 0, ImVec2(5, 2), 1.0f },
{ ImGuiKey_H, "h", "H", 0, ImVec2(6, 2), 1.0f },
{ ImGuiKey_I, "i", "I", 0, ImVec2(8, 1), 1.0f },
{ ImGuiKey_J, "j", "J", 0, ImVec2(7, 2), 1.0f },
{ ImGuiKey_K, "k", "K", 0, ImVec2(8, 2), 1.0f },
{ ImGuiKey_L, "l", "L", 0, ImVec2(9, 2), 1.0f },
{ ImGuiKey_M, "m", "M", 0, ImVec2(7, 3), 1.0f },
{ ImGuiKey_N, "n", "N", 0, ImVec2(6, 3), 1.0f },
{ ImGuiKey_O, "o", "O", 0, ImVec2(9, 1), 1.0f },
{ ImGuiKey_P, "p", "P", 0, ImVec2(10, 1), 1.0f },
{ ImGuiKey_Q, "q", "Q", 0, ImVec2(1, 1), 1.0f },
{ ImGuiKey_R, "r", "R", 0, ImVec2(4, 1), 1.0f },
{ ImGuiKey_S, "s", "S", 0, ImVec2(2, 2), 1.0f },
{ ImGuiKey_T, "t", "T", 0, ImVec2(5, 1), 1.0f },
{ ImGuiKey_U, "u", "U", 0, ImVec2(7, 1), 1.0f },
{ ImGuiKey_V, "v", "V", 0, ImVec2(4, 3), 1.0f },
{ ImGuiKey_W, "w", "W", 0, ImVec2(2, 1), 1.0f },
{ ImGuiKey_X, "x", "X", 0, ImVec2(2, 3), 1.0f },
{ ImGuiKey_Y, "y", "Y", 0, ImVec2(6, 1), 1.0f },
{ ImGuiKey_Z, "z", "Z", 0, ImVec2(1, 3), 1.0f },
{ ImGuiKey_F1, "F1", "", 1, ImVec2(2, 0), 1.0f },
{ ImGuiKey_F2, "F2", "", 1, ImVec2(3, 0), 1.0f },
{ ImGuiKey_F3, "F3", "", 1, ImVec2(4, 0), 1.0f },
{ ImGuiKey_F4, "F4", "", 1, ImVec2(5, 0), 1.0f },
{ ImGuiKey_F5, "F5", "", 1, ImVec2(6.5, 0), 1.0f },
{ ImGuiKey_F6, "F6", "", 1, ImVec2(7.5, 0), 1.0f },
{ ImGuiKey_F7, "F7", "", 1, ImVec2(8.5, 0), 1.0f },
{ ImGuiKey_F8, "F8", "", 1, ImVec2(9.5, 0), 1.0f },
{ ImGuiKey_F9, "F9", "", 1, ImVec2(11, 0), 1.0f },
{ ImGuiKey_F10, "F10","", 1, ImVec2(12, 0), 1.0f },
{ ImGuiKey_F11, "F11","", 1, ImVec2(13, 0), 1.0f },
{ ImGuiKey_F12, "F12","", 1, ImVec2(14, 0), 1.0f },
{ ImGuiKey_Apostrophe, "'", "\"", 0, ImVec2(11, 2), 1.0f },
{ ImGuiKey_Comma, ",", "<", 0, ImVec2(8, 3), 1.0f },
{ ImGuiKey_Minus, "-", "_", 0, ImVec2(11, 0), 1.0f},
{ ImGuiKey_Period, ".", ">", 0, ImVec2(9, 3), 1.0f },
{ ImGuiKey_Slash, "/", "?", 0, ImVec2(10, 3), 1.0f },
{ ImGuiKey_Semicolon, ";", ":", 0, ImVec2(10, 2), 1.0f },
{ ImGuiKey_Equal, "=", "+", 0, ImVec2(12, 0), 1.0f },
{ ImGuiKey_LeftBracket, "[", "{", 0, ImVec2(11, 1), 1.0f },
{ ImGuiKey_Backslash, "\\","|", 0, ImVec2(13, 1), 1.5f },
{ ImGuiKey_RightBracket, "]", "}", 0, ImVec2(12, 1), 1.0f },
{ ImGuiKey_GraveAccent, "`", "~", 0, ImVec2(0, 0), 1.0f },
{ ImGuiKey_CapsLock, "Caps", "", 0, ImVec2(0, 2), 1.75f },
{ ImGuiKey_ScrollLock, "\0", "", 0, ImVec2(0, 0), 1.0f }, // unused
{ ImGuiKey_NumLock, "\0", "", 0, ImVec2(0, 0), 1.0f }, //
{ ImGuiKey_PrintScreen, "\0", "", 0, ImVec2(0, 0), 1.0f }, //
{ ImGuiKey_Pause, "\0", "", 0, ImVec2(0, 0), 1.0f }, //
{ ImGuiKey_Keypad0, "0", "", 3, ImVec2(0, 4), 2.0f },
{ ImGuiKey_Keypad1, "1", "", 3, ImVec2(0, 3), 1.0f },
{ ImGuiKey_Keypad2, "2", "", 3, ImVec2(1, 3), 1.0f },
{ ImGuiKey_Keypad3, "3", "", 3, ImVec2(2, 3), 1.0f },
{ ImGuiKey_Keypad4, "4", "", 3, ImVec2(0, 2), 1.0f },
{ ImGuiKey_Keypad5, "5", "", 3, ImVec2(1, 2), 1.0f },
{ ImGuiKey_Keypad6, "6", "", 3, ImVec2(2, 2), 1.0f },
{ ImGuiKey_Keypad7, "7", "", 3, ImVec2(0, 1), 1.0f },
{ ImGuiKey_Keypad8, "8", "", 3, ImVec2(1, 1), 1.0f },
{ ImGuiKey_Keypad9, "9", "", 3, ImVec2(2, 1), 1.0f },
{ ImGuiKey_KeypadDecimal, ".", "", 3, ImVec2(2, 4), 1.0f },
{ ImGuiKey_KeypadDivide, "/", "", 3, ImVec2(1, 0), 1.0f },
{ ImGuiKey_KeypadMultiply, "*", "", 3, ImVec2(2, 0), 1.0f },
{ ImGuiKey_KeypadSubtract, "-", "", 3, ImVec2(3, 0), 1.0f },
{ ImGuiKey_KeypadAdd, "+", "", 3, ImVec2(3, 1), -2.0f }, // long keys!
{ ImGuiKey_KeypadEnter, "Ent", "", 3, ImVec2(3, 3), -2.0f },
{ ImGuiKey_KeypadEqual, "", "", 3, ImVec2(0, 0), 1.0f } // unused
};
static char *KeyModeTitles[] = {
"All",
"Viewport",
"Timeline",
"Graph",
"Brush"
};
static char *KeyModText[] = {
"ERROR",
"Ctrl",
"Alt",
"Shift",
"Ctrl + Shift"
};
static ImVec2 SectorOffset[4] = { ImVec2(0, 1.5), ImVec2(0, 0) , ImVec2(15.5, 1.5), ImVec2(19, 1.5) };
|