summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main.c b/main.c
index 93bac8a..31dd849 100644
--- a/main.c
+++ b/main.c
@@ -78,6 +78,7 @@ int main(void) {
SDL_Event event;
Uint8 const *keyboard_state = SDL_GetKeyboardState(NULL);
bool ctrl = keyboard_state[SDL_SCANCODE_LCTRL] || keyboard_state[SDL_SCANCODE_RCTRL];
+ bool shift = keyboard_state[SDL_SCANCODE_LSHIFT] || keyboard_state[SDL_SCANCODE_RSHIFT];
while (SDL_PollEvent(&event)) {
// @TODO: make a function to handle text buffer events
@@ -142,6 +143,15 @@ int main(void) {
}
}
break;
+ case SDLK_z:
+ if (ctrl) {
+ if (shift) {
+ buffer_undo(&text_buffer, 1);
+ } else {
+ buffer_redo(&text_buffer, 1);
+ }
+ }
+ break;
}
} break;
case SDL_TEXTINPUT: {