implemented interception of middle click for pasting selection

reimplemented mouse release event handler, and if it sees that the
middle mouse button and the clipboard supports selection (not Window),
then the text for the selection is passed to the insert text function