File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ class TextWindow : ChildWindow
103103 self.OnFocusIn += eventhandler(self, "onfocusin");
104104 self.OnFocusOut += eventhandler(self, "onfocusout");
105105 self.OnKeyPress += eventhandler(self, "onkeypress");
106+ self.OnButtonPress += eventhandler(self, "onbuttonpress");
106107 self.OnSelectionNotify += eventhandler(self, "onselectionnotify");
107108 }
108109 function ondestroy(event)
@@ -326,6 +327,18 @@ class TextWindow : ChildWindow
326327 }
327328 self.cursor();
328329 }
330+ function onbuttonpress(event)
331+ {
332+ switch (event.button()) {
333+ case 2:
334+ // Paste primary selection - unfinished
335+ var display = self.display;
336+ display.ConvertSelection(XA_PRIMARY,
337+ self.InternAtom(UTF8_STRING),
338+ XA_PRIMARY, self, event.time());
339+ break;
340+ }
341+ }
329342 function onselectionnotify(event)
330343 {
331344 var display = self.display;
You can’t perform that action at this time.
0 commit comments