Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to inhibit pasting with button 2 (wheel button) on Linux
How to inhibit pasting with button 2 (wheel button) on Linux [message #727111] Tue, 20 September 2011 12:37 Go to next message
H.ORTIZ  is currently offline H.ORTIZ Friend
Messages: 22
Registered: July 2009
Junior Member

I used a StyledText to implement a command line, thus the user is allowed to modify only the last line.
My problem is that a click on the "wheel button" paste the content of the clipboard under the mouse cursor and I don't know how to avoid that (there is no "doit" field in MouseEvent class).

Thanks in advance,

Re: How to inhibit pasting with button 2 (wheel button) on Linux [message #730016 is a reply to message #727111] Tue, 27 September 2011 13:47 Go to previous message
Felipe Heidrich is currently offline Felipe HeidrichFriend
Messages: 29
Registered: July 2009
Junior Member
How are you stopping keyboard input ?
You should be using a verify listener, and that should stopping the mouse wheel.

I suspect, the paste you are getting is coming from handleMouseUp():
//paste clipboard selection
if (event.button == 2) {
String text = (String)getClipboardContent(DND.SELECTION_CLIPBOARD);
if (text != null && text.length() > 0) {
// position cursor
doMouseLocationChange(event.x, event.y, false);
// insert text
Event e = new Event();
e.start = selection.x;
e.end = selection.y;
e.text = getModelDelimitedText(text);

Verify should be working ?
Previous Topic:Layout label and combo in fixed size window
Next Topic:SWT OLE 32 Bit and 64 Bit
Goto Forum:

Current Time: Thu Oct 29 03:19:09 GMT 2020

Powered by FUDForum. Page generated in 0.02192 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top