File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1084,6 +1084,21 @@ void main_loop(void) {
10841084 // printf("OSK handled the event.\n");
10851085 } else {
10861086 // printf("OSK passing event to default handler.\n");
1087+ if (ev .type == SDL_KEYDOWN ) {
1088+ if (ev .key .keysym .sym == SDLK_v ) {
1089+ const Uint8 * state = SDL_GetKeyboardState (NULL );
1090+ // Check for Ctrl AND Shift being pressed
1091+ bool ctrlPressed = state [SDL_SCANCODE_LCTRL ] || state [SDL_SCANCODE_RCTRL ];
1092+ bool shiftPressed = state [SDL_SCANCODE_LSHIFT ] || state [SDL_SCANCODE_RSHIFT ];
1093+ if (ctrlPressed && shiftPressed ) {
1094+ char * clipboardText = SDL_GetClipboardText ();
1095+ if (clipboardText ) {
1096+ tty_write (clipboardText , strlen (clipboardText ));
1097+ SDL_free (clipboardText ); // Free memory
1098+ }
1099+ }
1100+ }
1101+ }
10871102 if (event_handler [ev .type ]) (event_handler [ev .type ])(& ev );
10881103 }
10891104
You can’t perform that action at this time.
0 commit comments