Re: Trap mouse and keyboard events

2012-07-17 Thread Jason Perkins
Look for information on event taps. But be aware that they don't work in the 
application sandbox, so you won't be able to submit your app to the Mac App 
Store.

On Jun 25, 2012, at 1:56 AM, Abhijeet Singh wrote:

 Hi,I want to perform some action in my application whenever user presses any 
 key on keyboard or uses the mouse. How can I trap these 
 eventsThanksAbhijeetDear cocoadev ! Get Yourself a cool, short @in.com 
 Email ID now!
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/starkos%40industriousone.com
 
 This email sent to star...@industriousone.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Trap mouse and keyboard events

2012-06-25 Thread Graham Cox

On 25/06/2012, at 3:56 PM, Abhijeet Singh wrote:

 Hi,I want to perform some action in my application whenever user presses any 
 key on keyboard or uses the mouse. How can I trap these events...


RTFM?


--Graham
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Trap mouse and keyboard events

2012-06-25 Thread Richard Somers
On Jun 24, 2012, at 11:56 PM, Abhijeet Singh wrote:

 I want to perform some action in my application whenever user presses any key 
 on keyboard or uses the mouse. How can I trap these events.

One way to do this would be to subclass NSApplication and override sendEvent:. 
The documentation indicates Override sendEvent: if you want to change how 
events are dispatched or perform some special event processing.

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/nsapplication_Class/Reference/Reference.html

--Richard


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Trap mouse and keyboard events

2012-06-24 Thread Abhijeet Singh
Hi,I want to perform some action in my application whenever user presses any 
key on keyboard or uses the mouse. How can I trap these 
eventsThanksAbhijeetDear cocoadev ! Get Yourself a cool, short @in.com 
Email ID now!
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com