title: Using xdotool to locate click and apply appropriate action
body: <p>I would like to have xdotool detect if a right-click is on a particular window (I can capture window IDs without problem), and then run the appropriate shell command/function, if the click was on the desired window..</p>
  
  <p>In real terms this means I want xdotool to get the window ID of a VLC video playback window, and then to run a specific command if I right click on that window.</p>
  
  <p>I am using BASH 4.2.0(1)-release, and Xdotool 2.20101012.3049</p>
  
  <p>EDIT: This is as close as I have got, but it does not work:</p>
  
  <pre><code>xdotool search --name "VLC" behave %@ mouse-click exec 'myscript'
  </code></pre>
  
  <p>However, these commands DO work, but is not really what I need:</p>
  
  <pre><code>xdotool search --name "VLC" behave %@ mouse-enter exec 'myscript'
  
  xdotool search --name "VLC" behave %@ mouse-leave exec 'myscript'
  </code></pre>
  
  <p>Cheers..</p>