 |
 |
Counting keystrokes...
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2003
Status:
Offline
|
|
Hello,
I'm not sure if any of you were ever familiar with Project-Dolphin, now Project-Orca, just basically a project where you download a program to run and it counts how many keys you type, as a fun little statistic, nothing too useful.
There never was a Mac OS X client to interface with the project, so for fun I've been trying to figure out how to go about to create one. Right now though I am at a loss for finding a good way to perform an action upon a keystroke being pressed, with Windows you can set hooks, but with Mac OS X, I am not really sure.
I would appreaciate any ideas on how to handle that aspect.
Thanks for any assistance,
Charles
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2003
Status:
Offline
|
|
Not meaning to sound like I'm rushing... perhaps I should explain better.
The program would be running in the dock, where everykeystroke would be counted. What would you all consider to be the best way to call a method like updateCount when a keystroke is pushed?
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2003
Status:
Offline
|
|
Okay, anyone at least know what class I should subclass to override the keyDown event to perform my own stuff?
The program will just be running in the dock during the duration the computer is running, and every keystroke would be counted, so any ideas on what class I should subclass?
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by Charles.OBrien:
Okay, anyone at least know what class I should subclass to override the keyDown event to perform my own stuff?
The program will just be running in the dock during the duration the computer is running, and every keystroke would be counted, so any ideas on what class I should subclass?
I think you've pretty much hit on the reason nobody has answered your question--it can't be done that simply. Your application doesn't ordinarily receive keystrokes intended for other applications, so it has no way of counting them. I don't know of any Carbon call for it either (though that doesn't mean there isn't one), so I'd say your best bet would be an APE. If you don't want that, there's probably something in IOKit that could do it, but I couldn't be much more specific.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2003
Status:
Offline
|
|
I started to figure that was the case... thank you much, I'll take a look into what you suggested.
Charles
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
it can't be done that simply
Thank goodness for that. I'd rather not have every malcontent trying to infest my system with keyloggers.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Feb 2003
Status:
Offline
|
|
So, I am just trying to create this to be malicious? Not everything like this is meant for that sort of purpose, nor would it even be logging the specific keystroke but rather just up a quantity.
Now, I would like this topic to be locked... I have recieved my answer, and now people are reducing this to that of a malicious keylogger...
- Charles
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2000
Status:
Offline
|
|
Charles,
I never stated or implied that you wanted to make a malicious keylogger. You stated your intentions in the first post of this thread, and I have no reason not to believe you.
|
|
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status:
Offline
|
|
Originally posted by Charles.OBrien:
So, I am just trying to create this to be malicious? Not everything like this is meant for that sort of purpose, nor would it even be logging the specific keystroke but rather just up a quantity.
I think int69h was just commenting on why it's generally a good thing that Apple makes this difficult, not talking about your case in particular.
|
|
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
The good news? Apple provides hooks for generic keyboard input components -- these hooks are used by their own input methods (which is how you can type Japanese or Chinese without a 10,000-key keyboard; see the Input Menu pane of International Preferences) and are available for third parties (which often use them for things like input devices for the disabled).
The bad news? There are two APIs for this: a Cocoa one that's easy to write to but only covers Cocoa apps, and a yucky old Carbon API that applies to input in all applications.
For the former, look here. For the latter, see this documentation.
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Jun 2001
Location: Seattle
Status:
Offline
|
|
Originally posted by Rickster:
...and a yucky old Carbon API that applies to input in all applications.
So if apple were to implement a log-out w/o quitting ala windows, could these programs still grab keystrokes?
~BS
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
That, of course, would depend on how they implemented it. 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|