Author Topic: How to disable paste by middle mouse buttons?  (Read 11318 times)

Offline notonroof

  • Single posting newcomer
  • *
  • Posts: 7
How to disable paste by middle mouse buttons?
« on: February 15, 2014, 09:41:49 pm »
Hi, Code::Block 13.12 sometimes randomly paste fragments of code at random position in my codebase. But now i discovered its not bug, its feature! :-) When i copy in Code::Blocks something to clipboard and then press midle mouse button, text is pasted. Please how to disable it?

Here http://forums.codeblocks.org/index.php?topic=18267.0 are written "On windows, just disable the MouseSap-plugin"

I am on windows, i disabled it, uninstaled MouseSap-plugin, restarted Code::Blocks, but this has no effect, nothing helps.

Please, how to disable this error prone feature?
« Last Edit: February 15, 2014, 09:48:58 pm by notonroof »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: How to disable paste by middle mouse buttons?
« Reply #1 on: February 16, 2014, 03:31:42 am »
In CB 12.11, disabling MouseSap did stop this feature.

In CB 13.12, it failed to stop this feature.


Tim S.
« Last Edit: February 16, 2014, 04:25:37 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: How to disable paste by middle mouse buttons?
« Reply #2 on: February 16, 2014, 03:46:04 am »
In Code::Blocks 13.12, middle mouse paste is emulated by the core application to improve functionality, as compared to Linux' native middle mouse paste (which cannot easily be used due to a wx28 clipboard bug).  Unfortunately, this means that disabling this can currently only be done by editing the source and recompiling (the relevant file is sdk/cbstyledtextctrl.cpp line 125).

Offline scarphin

  • Lives here!
  • ****
  • Posts: 644
Re: How to disable paste by middle mouse buttons?
« Reply #3 on: February 16, 2014, 08:52:00 am »
IMHO the enforcement in the core shouldn't be the way. Anyway I disable it by enabling scrolling in 'Mouse Drag Scrolling' plugin and choosing the 'Mouse Key To Use:' as 'Middle'.

Offline notonroof

  • Single posting newcomer
  • *
  • Posts: 7
Re: How to disable paste by middle mouse buttons?
« Reply #4 on: February 17, 2014, 04:54:16 pm »
@scarphin: Thanks! It works.

Step-by-step guide, how to disable middle mouse button click paste in Code::Blocks 13.12 :

* Go into Main menu/Settings->Editor->Mouse Drag Scrolling
* Check "Scrolling Enabled"
* In "Mouse Key To Use" select "Middle"
* Click OK to close dialog
* Restart Code::Blocks


« Last Edit: February 17, 2014, 04:55:52 pm by notonroof »

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: How to disable paste by middle mouse buttons?
« Reply #5 on: November 26, 2014, 03:25:13 pm »
@scarphin, @notonroof
 thanks, it' good. I was looking for a while !
Regards
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: How to disable paste by middle mouse buttons?
« Reply #6 on: November 26, 2014, 05:35:11 pm »
hello everybody,

two things:

a) does this mean the mouse sap plugin is obsolete? what other benefits/functions does it provide?

b) the solution of assigning the middle mouse button to something else really does work perfectly, but non the less it is only a hack...

regards
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2774
Re: How to disable paste by middle mouse buttons?
« Reply #7 on: November 26, 2014, 07:28:38 pm »
The mousesap plugin was created to emulate the linux paste behavior on windows.

It still works for that purpose. I use (and like) it nearly every day.
It provides additional functions such as: mark text, then just middle click every where you want that text pasted.

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: How to disable paste by middle mouse buttons?
« Reply #8 on: November 27, 2014, 12:44:04 pm »
@Pecan

Maybe I understood wrong...  ???

As Alpha posted, that behavior is already implemented since c::b 13.12 by the core application... so it should already work the same under windows and linux since then...

The described functionality is exactly to copy some text, or to just mark it, and then paste that text by middle mouse button where ever you click. So that would be the same behavior that you described for mouse sap. Does mouse sap do anything else besides that? Am I missing something, maybe?

Greetings

PS: and yes, someone using a version of c::b prior to 13.12 under windows would still have use for the mouse sap plugin...
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2774
Re: How to disable paste by middle mouse buttons?
« Reply #9 on: November 27, 2014, 07:52:12 pm »
With mousesap plugin, the user does not have to ctrl-c or ctrl-v.

Mark some text, then just paste via clicking the middle mouse.

If you Ctrl-c some text, then mark any other text, middle mouse replaces the marked text.

mousesap is a little more versatile.

Offline frithjofh

  • Regular
  • ***
  • Posts: 376
Re: How to disable paste by middle mouse buttons?
« Reply #10 on: November 28, 2014, 10:26:02 am »
@Pecan

thx for the answer.

i am using a linux OS and the last c::b compiled from svn. i just activated the mouse sap plugin and tried out that feature you mentioned ("...Ctrl-c some text, then mark any other text, middle mouse replaces the marked text...."). This does not work on my linux box. Instead it pastes the same selected text inside the selected text itself at the place I clicked (it does not replace the marked text with the contents of the Ctrl-c).

I like the feature, but as it seams, it does not work on a linux system. So for the time being I won't use mouse sap, as its other functionality (...mark some text and paste it somewhere else with middle mouse click...) already is implemented in c::b core app or works on linux out of the box. Actually I use it a lot in many applications :)

regards
architect with some spare time  -  c::b compiled from last svn  -   openSuSE leap x86_64  -  AMD FX-4100