diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-21 13:02:30 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-12-21 13:02:30 -0500 |
commit | 41c33e59e85909989009e96370403abf319008ad (patch) | |
tree | 2f52edfef50e792315e8277acbf7e0e6fec340b5 /main.c | |
parent | b50f5c763c575d7284b7a7e7507b2151d1e98fbf (diff) |
more undo
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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: { |