Added the functionality for middle and right mouse clicks

Hi, I have added the the functionality for middle and right mouse clicks. Please review.