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.
Oh, I didn't know that. Thanks Max!