• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
disabling right-mouse click and ctrl+click?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

disabling right-mouse click and ctrl+click?


  • Subject: disabling right-mouse click and ctrl+click?
  • From: Khusro Jaleel <email@hidden>
  • Date: Thu, 03 Mar 2005 13:37:09 +0000

Hi,

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,

Khusro
_______________________________________________
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


  • Follow-Ups:
    • Re: disabling right-mouse click and ctrl+click?
      • From: "John C. Warner" <email@hidden>
    • Re: disabling right-mouse click and ctrl+click?
      • From: j o a r <email@hidden>
  • Prev by Date: Re: Table Column Drawing Weirdness
  • Next by Date: When do bound UI items set their data source?
  • Previous by thread: Re: NSUserPath for path to user folder?
  • Next by thread: Re: disabling right-mouse click and ctrl+click?
  • Index(es):
    • Date
    • Thread