Fix right mouse button detection with smoothing

Fixes issue #42