summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/window.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 41d8078f..22ad02eb 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -706,6 +706,18 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) {
706 } 706 }
707 } 707 }
708 iWidget *oldHover = hover_Widget(); 708 iWidget *oldHover = hover_Widget();
709 /* As a special case, clicking the middle mouse button can be used for pasting
710 from the clipboard. */
711 if (event.type == SDL_MOUSEBUTTONDOWN && event.button.button == SDL_BUTTON_MIDDLE) {
712 SDL_Event paste;
713 iZap(paste);
714 paste.type = SDL_KEYDOWN;
715 paste.key.keysym.sym = SDLK_v;
716 paste.key.keysym.mod = KMOD_PRIMARY;
717 paste.key.state = SDL_PRESSED;
718 paste.key.timestamp = SDL_GetTicks();
719 dispatchEvent_Widget(widget, &paste);
720 }
709 /* Dispatch the event to the tree of widgets. */ 721 /* Dispatch the event to the tree of widgets. */
710 iBool wasUsed = dispatchEvent_Widget(widget, &event); 722 iBool wasUsed = dispatchEvent_Widget(widget, &event);
711 if (oldHover != hover_Widget()) { 723 if (oldHover != hover_Widget()) {