Support added for extra mouse buttons. Since these buttons were not returned by XQueryPointer(), some additional logic was needed which fit best to scroll wheel handling.