How to modify system mouse cursor programatically?

Discussion in 'Mac Programming' started by laphroaig309, Oct 1, 2010.

  1. laphroaig309
    Expand Collapse
    macrumors newbie

    Joined:
    Oct 1, 2010
    #1
    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...
     
  2. gnasher729
    Expand Collapse
    macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #2
    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.
     
  3. laphroaig309
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Oct 1, 2010
    #3
    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?
     
  4. gnasher729
    Expand Collapse
    macrumors G5

    gnasher729

    Joined:
    Nov 25, 2005
    #4
    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".
     
  5. laphroaig309
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Oct 1, 2010
    #5
    Hi Gnasher729:

    Many thanks for your guidance.

    1. Agent App:
    (ref. http://developer.apple.com/library/...onceptual/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)
     
  6. mrbash
    Expand Collapse
    macrumors 6502

    Joined:
    Aug 10, 2008
    #6
    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.
     
  7. laphroaig309
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Oct 1, 2010
    #7
    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.
     
  8. coder12
    Expand Collapse
    macrumors 6502a

    coder12

    Joined:
    Jun 28, 2010
    #8

    Like this? http://unsanity.com/haxies/mightymouse :rolleyes:
     
  9. laphroaig309
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Oct 1, 2010
    #9
  10. mrbash
    Expand Collapse
    macrumors 6502

    Joined:
    Aug 10, 2008
    #10
    "mightmouse" is not compatible with Snow Leopard
     
  11. Sydde
    Expand Collapse
    macrumors 68020

    Sydde

    Joined:
    Aug 17, 2009
    #11
    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.
     

Share This Page