Note that you need to do some callbacks and stuff to make sure you manage when it's running and not, and you need to give the command enough time for the selection to change (i.e. if you double click - thats what the 50 ms are for).

But again... Please don't use it, at least not without THOROUGH testing.