Author Topic: disabling the middle mouse buttons "copy - paste" functionality  (Read 11805 times)

Offline christobal

  • Multiple posting newcomer
  • *
  • Posts: 41
disabling the middle mouse buttons "copy - paste" functionality
« on: January 29, 2008, 08:18:24 am »
Hello everyone

I use Code::Blocks now for some time and have occasionally a problem when I scroll through the source code. The problem is, that I somtimes accidetally press the mouse wheel, which is interpreted as "pressed middle button" by Code::Blocks. And if now, in addidion to that, some text was previously selected, it will be pasted at the current cursor position. Usually I don't even notice it until the next build.

So I think that it could be useful to disable the "middle-mouse-button" copy - paste functionality in the Code::Blocks Editor Settings menue (this will only be possible for windows users). Beside that, it could prevent a conflict with the "mouse drag-scrolling" if the middle mouse button is selected for drag-scrolling.

Thanks

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2143
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #1 on: January 29, 2008, 03:27:54 pm »
I didn't even know about the middle-mouse button as a paste function.
But I can certainly fix the conflict when it's used for cbDragScroll.

I cannot enable/disable it for the editor though.


Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #2 on: January 29, 2008, 03:40:14 pm »
It was added October 2, 2006 on account of feature request 2660.
During the 484 days since then, there never seemed to be a need for turning off this feature, so none was built in. I guess that if the dragscroll plugin interferes, you can simply push an event handler for the middle mouse button, this should catch it early.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2143
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #3 on: January 29, 2008, 06:40:05 pm »
... Beside that, it could prevent a conflict with the "mouse drag-scrolling" if the middle mouse button is selected for drag-scrolling.
...

Fixed for DragScroll in svn 4849

Offline christobal

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #4 on: January 30, 2008, 10:21:47 am »
Quote
It was added October 2, 2006 on account of feature request 2660.
During the 484 days since then, there never seemed to be a need for turning off this feature, so none was built in.

At first I thought it was a problem with the key binder (according to http://forums.codeblocks.org/index.php/topic,6003.msg56341.html#msg56341) , so I deactivated it. Maybe mastermatic and numpty had the same problem.

I think the option to turn it off would be useful. Otherwise I'll have to use cbDragScroll to catch the Mouse events (even if I don't really like to scroll with the pressed mouse wheel).

Offline nanyu

  • Almost regular
  • **
  • Posts: 187
  • nanyu
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #5 on: May 22, 2010, 09:43:43 pm »
We can now disable this feature (paste when I press the middle mouse button)?
This feature is too strange. And too easy to make a mistake.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1442
    • CenizaSOFT
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #6 on: May 22, 2010, 10:42:21 pm »
We can now disable this feature (paste when I press the middle mouse button)?
This feature is too strange. And too easy to make a mistake.

It is not too strange. That is default behavior in *nix. As a matter of fact I hate it when I am at the office and try to paste something with the middle mouse button and nothing happens (Windows XP). It may be strange at first for Windows users, though.

Just being able to disable it in Windows should be enough.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11770
    • Travis build status
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #7 on: May 23, 2010, 01:08:41 am »
We can now disable this feature (paste when I press the middle mouse button)?
This feature is too strange. And too easy to make a mistake.
OS? CB version? Do you have the mousesap (not sure if this was the plugin that implemented this feature) plugin enabled?

It is not too strange. That is default behavior in *nix. As a matter of fact I hate it when I am at the office and try to paste something with the middle mouse button and nothing happens (Windows XP). It may be strange at first for Windows users, though.

Just being able to disable it in Windows should be enough.
The strange thing is it doesn't work here - gentoo linux amd64~ (unstable/testing) + enlightenment dr 17
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline nanyu

  • Almost regular
  • **
  • Posts: 187
  • nanyu
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #8 on: May 23, 2010, 07:14:31 am »
OS? CB version? Do you have the mousesap (not sure if this was the plugin that implemented this feature) plugin enabled?

Yes, I'm in the windows xp. cb (svn 6271) , but as said, "It was added October 2, 2006 on account of feature request 2660."

Offline geckon

  • Single posting newcomer
  • *
  • Posts: 4
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #9 on: May 23, 2010, 12:45:19 pm »
Hi,
the "paste" functionality works at my place, but only when something is already "stored" in the clipboard. The "copy" function doesn't work -- I mean when I select some part of code and want to paste it elsewhere. Is that default behavior or is something broken here? I use C::B 8.02 installed from Ubuntu 10.04 universe repository.
Thanks for your response.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2143
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #10 on: May 23, 2010, 01:47:15 pm »
For Windows:
  Pasting with the middle mouse button has always been available in CB. It only pastes when a selection has been previously marked.
To my knowledge, it's hard coded.

MouseSap extended that feature for both window and linux as follows:

If the cursor is withing a marked selection, middle mouse copies it to the clipboard.
Without a selection it pastes the clipboard to the cursor location.

With shift and middle mouse and the cursor is withing a selection, it pastes the clipboard over the selection.

Offline nanyu

  • Almost regular
  • **
  • Posts: 187
  • nanyu
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #11 on: May 23, 2010, 05:32:40 pm »
I like this behavior: select some text (but not copied to the clipboard), click the middle mouse button, paste it into the target location.

But I do not like this behavior: I press "Ctrl + C" Copy some text to the clipboard (and possibly in the word processing software), then in the Code:: Blocks where I accidentally press the mouse middle button several times ... ... totally messed up my code. The worst is that sometimes I did not even notice this behavior.
« Last Edit: May 23, 2010, 05:51:39 pm by nanyu »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2143
Re: disabling the middle mouse buttons "copy - paste" functionality
« Reply #12 on: May 24, 2010, 02:01:26 pm »
I like this behavior: select some text (but not copied to the clipboard), click the middle mouse button, paste it into the target location.

But I do not like this behavior: I press "Ctrl + C" Copy some text to the clipboard (and possibly in the word processing software), then in the Code:: Blocks where I accidentally press the mouse middle button several times ... ... totally messed up my code. The worst is that sometimes I did not even notice this behavior.

Then, if you are running the plugin MouseSap, remove it.
If you are not running MouseSap, you must be on Linux, where the "feature" is hard coded into the OS.

« Last Edit: May 24, 2010, 02:12:10 pm by Pecan »