Handling global event

Discussion in 'Mac Programming' started by shtuceron, Mar 17, 2010.

  1. shtuceron macrumors newbie

    Joined:
    Dec 22, 2009
    #1
    I am sorry for stupid question, but how use addGlobalMonitorForEventsMatchingMask method?? Can you get me some project where using this method.
    Thanks.
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  3. shtuceron thread starter macrumors newbie

    Joined:
    Dec 22, 2009
    #3
    yes i looked. May be i dont understand right,
    addLocalMonitorForEventsMatchingMask:handler: - method which get event (example key press) into our program, addGlobalMonitorForEventsMatchingMask:handler: - method which get event from other application and 'pass' it into our program (even our application is not active)??

    addLocalMonitorForEventsMatchingMask - work, addGlobalMonitorForEventsMatchingMask - not working, therefore i asked you send me project where this method work.
     
  4. gnasher729 macrumors P6

    gnasher729

    Joined:
    Nov 25, 2005
    #4
    What do you mean by "doesn't work"? Remember that for example a key event would only be sent to the active application, so it would be recognised by a _local_ monitor in the active application, and by a _global_ monitor in any other (inactive) application.
     
  5. shtuceron thread starter macrumors newbie

    Joined:
    Dec 22, 2009
    #5
    OK, _local_ monitor and _global_ monitor this is abstract name or no, never i doesn't work with event, and don't understand you fully
     
  6. Alkiera macrumors regular

    Joined:
    Mar 11, 2008
    #6
    I think he means you will never see the same event in both monitors. If your application is currently in focus, clicks/keys will register on the local monitor. If it is not the focused application, they will register with the global monitor.
     
  7. shtuceron thread starter macrumors newbie

    Joined:
    Dec 22, 2009
    #7
    This discussion is very useful for me, but the problem is not solution addLocalMonitorForEventsMatchingMask is work, the applicaton is active, addGlobalMonitorForEventsMatchingMask not working, may be you get me some example code, project where using addGlobalMonitorForEventsMatchingMask.
     

Share This Page