Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How to count mouse clicks?

How to count mouse clicks?
Thread Tools
Senior User
Join Date: Sep 2000
Location: Shallow Alto, CA
Status: Offline
Reply With Quote
Sep 9, 2003, 02:01 PM
 
Hi,

I know almost nothing about programming, so I need some ideas on how to make this simple little application.

I need an app that counts mouse clicks. It needs to count them no matter what is in the foreground. A gui with "reset" "pause" and "start" buttons would be icing on the cake, but even a little shell script would do the trick.

I have all the developer tools installed, but have no clue where to begin.

Any ideas? Is there a function that detects the state of the mouse button?

ps. I want the app so that I can open an image in Photoshop, create a layer, then click on spots on the image (marking them with a brush) and counting them as I go.
     
Mac Enthusiast
Join Date: Mar 2000
Location: atx, usa
Status: Offline
Reply With Quote
Sep 9, 2003, 03:07 PM
 
Originally posted by foamy:
Hi,

I know almost nothing about programming, so I need some ideas on how to make this simple little application.

I need an app that counts mouse clicks. It needs to count them no matter what is in the foreground. A gui with "reset" "pause" and "start" buttons would be icing on the cake, but even a little shell script would do the trick.

I have all the developer tools installed, but have no clue where to begin.

Any ideas? Is there a function that detects the state of the mouse button?

ps. I want the app so that I can open an image in Photoshop, create a layer, then click on spots on the image (marking them with a brush) and counting them as I go.
look at NSView. im not sure what you want to do exactly with your app. but it is easy to make an app that opens an image in an NSView subclass and as part of the NSView superclass there are methods which allow you to find the location of the points within the view (the 'marking' aspect you describe). also possible to count the number of mouseclicks within the view.

with your own subclass, you wouldn't need photoshop. again, not sure if it is necessary to use photoshop. if you just need to display an image, it can be done easily.

look at the NSView subclass. there is also a section in Hillegass(sp?)'s book, that got me started. it's a good book, imo.

hope this helps some.

adam
"do unto others as you would have them do unto you" begins with yrself.

"He that fights for Allah's cause fights for himself. Allah does not need His creatures' help." -koran, the spider, 29:7
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:22 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2