Re: disabling right-mouse click and ctrl+click?
Re: disabling right-mouse click and ctrl+click?
- Subject: Re: disabling right-mouse click and ctrl+click?
- From: j o a r <email@hidden>
- Date: Thu, 3 Mar 2005 14:52:37 +0100
I guess that what you don't realize is that the contextual menu for
text fields being edited comes from the "field editor" of the window.
Check the documentation for more info about the field editor!
Have you "protected" against someone using drag-and-drop to copy values
from your windows?
j o a r
On 2005-03-03, at 14.37, Khusro Jaleel wrote:
I'm quite a newbie to cocoa development and I've got a major problem
on my hands and I hope you guys will be a bit patient and help me sort
this out. All I want to do is somehow stop mouse right-clicking and
ctrl+clicking (equiv. of right click) from working in a cocoa app that
I have been given. I have full access to the sources so I can pretty
much change anything.
The main reason is that users should not be allow to cut/copy/paste
from the app. So I have removed the menu entries in IB, and removed
the shortcuts so they cannot do it anymore from the keyboard. However,
the mouse still works, so if they right-click or ctrl+click within a
webview, they get a nice helpful context menu. I don't know how to
disable this context menu so I thought maybe I should just disable
right-clicking to make it easier. Is this the correct approach? Is
there an easier way to just disable cut/copy/paste from working within
an entire app?
So far, I have done the following:
I have managed to hack around in the code and change calls to [super
rightMouseDown:event] to work as left clicks by creating an NSEvent
for left mouse down. So if they right-click with a 2-button mouse, it
works like a left-click.
The remaining places where I need to disable it are the following:
1. CTRL+click still generates a right-click, how do I catch it and
discard it?
2. The app uses a WebView to display a browser window. Right-clicking
with a 2-button mouse does not work in the window, but in the
TextFields within the window it does work! I need to somehow disable
it from working within the textfields and textareas. Do I need to
somehow subclass WebView and make my own custom class to do this?
Any help much appreciated,
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden