title: How to get current type of mouse cursor in Mac OS X?
body: <p>How can I get the current type of mouse cursor on screen? (Not only on my app window, globally.) Or is it at least possible to detect whether the default cursor is currently displayed? Either Carbon or Cocoa is OK – or even other working APIs, preferably the official ones.</p>
  
  <p>This is what I have tried:</p>
  
  <pre><code>NSCursor *sysCursor = [NSCursor currentSystemCursor];
  
  if (sysCursor == nil) {
      NSLog(@"nil");
  }
  
  if ([sysCursor isEqual: [NSCursor arrowCursor]] || 
      [sysCursor isEqual: [NSCursor contextualMenuCursor]] || 
      [sysCursor isEqual: [NSCursor closedHandCursor]] || 
      [sysCursor isEqual: [NSCursor crosshairCursor]] || 
      [sysCursor isEqual: [NSCursor disappearingItemCursor]] || 
      [sysCursor isEqual: [NSCursor dragCopyCursor]] || 
      [sysCursor isEqual: [NSCursor dragLinkCursor]] || 
      [sysCursor isEqual: [NSCursor IBeamCursor]] || 
      [sysCursor isEqual: [NSCursor openHandCursor]] || 
      [sysCursor isEqual: [NSCursor operationNotAllowedCursor]] || 
      [sysCursor isEqual: [NSCursor pointingHandCursor]] || 
      [sysCursor isEqual: [NSCursor resizeDownCursor]] || 
      [sysCursor isEqual: [NSCursor resizeLeftCursor]] || 
      [sysCursor isEqual: [NSCursor resizeLeftRightCursor]] || 
      [sysCursor isEqual: [NSCursor resizeRightCursor]] || 
      [sysCursor isEqual: [NSCursor resizeUpCursor]] || 
      [sysCursor isEqual: [NSCursor resizeUpDownCursor]] || 
      [sysCursor isEqual: [NSCursor IBeamCursorForVerticalLayout]]
      ) {
      NSLog(@"equal");
  } else {
      NSLog(@"not");
  }
  </code></pre>
  
  <p>The cursor is not <code>nil</code>, but at the same time it’s not equal to any of the others. It’s not even equal to itself:</p>
  
  <pre><code>NSLog(@"%i", [[NSCursor currentSystemCursor]
      isEqual:[NSCursor currentSystemCursor]]); // 0
  </code></pre>
  
  <p>Ideas? This is a <code>LSUIElement</code>-type app, if that matters.</p>