[Gambas-user] middle mouse paste

Bruce Steers bsteers4 at gmail.com
Tue Dec 27 18:13:17 CET 2022


Having problems with gambas doing middle mouse click pasting text !
It's really annoying as my mouse is a bit rubbish and i keep accidentally
pasting text as i'm scrolling with the wheel and messed some code up a few
times.

I disabled the feature on my mate desktop settings and now it does not
happen on things like pluma or mate terminal but it's still happening in
the IDE.

Okay i just checked the code and it seems yes ,
TextEditor.class / View_MouseUp() pastes text if middle mouse.

I added a fix in my scripted editor I override the View_MouseUp() method
like this..

Public Sub View_MouseUp()

  If Mouse.Middle And If Not Me.ReadOnly And If Not $bMiddleMousePaste Then
    Me.ReadOnly = True
    Super.View_MouseUp
    Me.ReadOnly = False
  Else
    Super.View_MouseUp
  Endif

End

So if middle mouse is clicked and doc is not readonly and my
MiddleMousePaste property is false it sets readonly property to true then
fires the super mouseup event then sets readonly to false again.

That seemed the best way to override in an automatically inherited
TextEditor.class in my own application but it would be great if we could
get a simple property like that for TextEditor.class Ben, to disable middle
mouse paste.
(and a toggle for it in the IDE editor prefs)

Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20221227/16ff5272/attachment.htm>


More information about the User mailing list