News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How to disable paste by middle mouse buttons?

Started by notonroof, February 15, 2014, 09:41:49 PM

Previous topic - Next topic

notonroof

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.next.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?

stahta01

#1
In CB 12.11, disabling MouseSap did stop this feature.

In CB 13.12, it failed to stop this feature.


Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

Alpha

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).

scarphin

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'.

notonroof

#4
@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



LETARTARE

@scarphin, @notonroof
thanks, it' good. I was looking for a while !
Regards
CB-13834, plugins-sdk-2.25.0 : Collector-2.6.5, AddOnForQt-5.1.2
1- Win7 Business Pack1 64bits : wx-3.2.8, gcc-15.2.0,
2- OpenSuse::Leap-15.6-64bits : wx-3.2.8;gtk3-u, gcc-15.2.0,
=> !! The messages are translated by 'Deepl'

frithjofh

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

Pecan

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.

frithjofh

@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

Pecan

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.

frithjofh

@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