PDA

View Full Version : How to modify system mouse cursor programatically?




laphroaig309
Oct 1, 2010, 05:42 AM
Hi friends:

I am developing an application and I hope it can "change" the system cursor
, say from Arrow type to "Cross Hair" type, programatically.

I just read the NSCursor/NSWindow etc, and can't find any clue to achieve it.

Can anyone help me?

Thanks in advance.

ps:Maybe I should initiate a NSWindow and dynamically place it on the system cursor. It's kind of stupid though...



gnasher729
Oct 1, 2010, 06:40 AM
Hi friends:

I am developing an application and I hope it can "change" the system cursor
, say from Arrow type to "Cross Hair" type, programatically.

I just read the NSCursor/NSWindow etc, and can't find any clue to achieve it.

Can anyone help me?

Thanks in advance.

ps:Maybe I should initiate a NSWindow and dynamically place it on the system cursor. It's kind of stupid though...

What you want is either very simple, or it is very complex and you probably shouldn't do it. Please try to write as clearly as possible what you actually want to achieve. The end result, not the steps in between. When you write it, remember we cannot read your mind. Assume that you pay me $10,000 to write code that does what you describe, and you have to pay up if the code does what you described, not if it does what you want.

laphroaig309
Oct 1, 2010, 08:01 AM
Hi gnasher729:

Thanks for your patience & instructions.

Allow me to re-state as following:

Can my agent APP change system mouse cursor to my specified Image file, say
new_cursor.jpg, and restore the system mouse cursor style once my agent APP quits?

gnasher729
Oct 1, 2010, 10:20 AM
Hi gnasher729:

Thanks for your patience & instructions.

Allow me to re-state as following:

Can my agent APP change system mouse cursor to my specified Image file, say
new_cursor.jpg, and restore the system mouse cursor style once my agent APP quits?

Quoting myself: " Please try to write as clearly as possible what you actually want to achieve. The end result, not the steps in between. When you write it, remember we cannot read your mind."

So what is an "agent APP"? What do you mean by "change system mouse cursor"? What do you actually want to achieve? Describe the behaviour in terms of what a user would see on a screen. Write something like "if the user does xxx then the mouse cursor should look like yyy".

laphroaig309
Oct 1, 2010, 11:07 AM
Quoting myself: " Please try to write as clearly as possible what you actually want to achieve. The end result, not the steps in between. When you write it, remember we cannot read your mind."

So what is an "agent APP"? What do you mean by "change system mouse cursor"? What do you actually want to achieve? Describe the behaviour in terms of what a user would see on a screen. Write something like "if the user does xxx then the mouse cursor should look like yyy".

Hi Gnasher729:

Many thanks for your guidance.

1. Agent App:
(ref. http://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/BPSystemStartup.pdf)

My agent app will start automatically after user log in.
(Users don't have to start my agent manually)

2. And then the agent will change the cursor from Arrow type to my desired type, say, the Apple logo.
(User will see an apple logo system mouse cursor.)

3. If user logout or if my agent app is killed, then the system mouse cursor
will be Arrow type again. (User will see an arrow type system mouse cursor)

mrbash
Oct 1, 2010, 11:32 AM
From the vague description you have provided, I would say that you cannot do what you are trying to.

While your app is in focus you can change the cursor icon, but not otherwise.

laphroaig309
Oct 1, 2010, 09:19 PM
From the vague description you have provided, I would say that you cannot do what you are trying to.

While your app is in focus you can change the cursor icon, but not otherwise.

Hi MrBas:
You are absolutely correct. I can change cursor icon for my application.
However, I am looking for possible ways to change system mouse cursor
programatically.

coder12
Oct 2, 2010, 11:14 AM
Hi MrBas:
You are absolutely correct. I can change cursor icon for my application.
However, I am looking for possible ways to change system mouse cursor
programatically.


Like this? http://unsanity.com/haxies/mightymouse :rolleyes:

laphroaig309
Oct 2, 2010, 07:06 PM
Like this? http://unsanity.com/haxies/mightymouse :rolleyes:


Hi Coder12:

Yes. Do you have any idea/clue about how to do that? Thank you.

mrbash
Oct 2, 2010, 09:13 PM
"mightmouse" is not compatible with Snow Leopard

Sydde
Oct 3, 2010, 05:52 AM
Hi Coder12:

Yes. Do you have any idea/clue about how to do that? Thank you.

Unsanity piggybacks all their "haxies" onto a thing called "Application Enhancer". A cursory inspection seems to indicate that the Application Enhancer Installer application makes a modification to a BSD file or two in order for it to load before login, so that it can activate the haxies. To me, that looks like a pretty deep level to be working at, not the kind of thing you can accomplish with a simple application.