title: How can I override the 3-finger tap behavior in a NSTextView?
body: <p>On Mac OS X, doing a 3-finger tap on a word pops up a window with a definition of the word.</p>
  
  <p><img src="https://i.stack.imgur.com/tbEHn.png" alt="Image showing a pop up window showing a word definition."></p>
  
  <p>This idiom is also used in Xcode, where doing a 3-finger tap over a symbol shows its documentation, much like if it had been alt+clicked.</p>
  
  <p><img src="https://i.stack.imgur.com/p0iXD.png" alt="Image showing a pop up window showing symbol documentation."></p>
  
  <p>I would like to do something similar to that and display definitions when users of my application do a 3-finger tap on certain tokens in a <code>NSTextView</code>. However, I can't find how to detect that a tap has been done with 3 fingers. Could someone help me with that?</p>
  
  <p><strong>EDIT</strong> If this reminds anything to anyone, three events (caught by overriding <code>[NSApplication sendEvent:]</code>) are triggered when you do this kind of tap:</p>
  
  <pre><code>NSEvent: type=SysDefined loc=(270.918,250.488) time=417954.6 flags=0x100 win=0x0 winNum=28293 ctxt=0x0 subtype=6 data1=1818981744 data2=1818981744
  NSEvent: type=SysDefined loc=(270.918,250.488) time=417954.6 flags=0x100 win=0x0 winNum=28293 ctxt=0x0 subtype=9 data1=1818981744 data2=1818981744
  NSEvent: type=Kitdefined loc=(0,263) time=417954.8 flags=0x100 win=0x0 winNum=28306 ctxt=0x0 subtype=4 data1=1135411200 data2=1132691456
  </code></pre>