Added hook on paste event to search for the pasted input.

Added support for paste event that didn't work on Mac OSX (it worked with Windows and Linux though). Now it works on every OS.
I was just suggesting extracting the Scheduler call to a private method to reduce the anonymous class calls nesting