• 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
Re: Mouse with 1, 2 or 3 buttons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mouse with 1, 2 or 3 buttons


  • Subject: Re: Mouse with 1, 2 or 3 buttons
  • From: Gregory Weston <email@hidden>
  • Date: Sat, 9 Apr 2005 10:28:20 -0400

Hi,
I would like to detect how many buttons the current mouse has, and if it has
got the wheel. So, for instance, I can program:


1. if the mouse has one button only, the user has to press the mouse
button and hold down the Control key to do the action "A".
2. if the mouse has 2 buttons, the user can press the right button
to do the action "A". So he can press the left button + Control key
to do the action "B".


Is a way to detect that? Is this approach correct? Thank you.

I think the approach is flawed. Since we're on Cocoa-Dev, I assume you're using NSResponder and its offspring. You can receive messages indicating various buttons have been pressed so I'd be looking at reacting to those messages and let the OS and user do what they need to do to get them to you. (Like at the moment, IIRC, ctrl-click becomes a right click unless explicitly overriden. I'm not sure what chord, if any, generates other button presses. Hopefully eventually an interface will be provided to let the user configure actions that will map to various buttons on their machines.)


G

_______________________________________________
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


  • Prev by Date: Re: Packages vs. Finder (perceived stability problem)
  • Next by Date: Tiger GM Build 8a428
  • Previous by thread: Re: Mouse with 1, 2 or 3 buttons
  • Next by thread: GDB: How to access arguments
  • Index(es):
    • Date
    • Thread