pyvnc_sync/pyvnc_sync.py
def pointer_event(self, buttons=[], down=False, x=0, y=0):
        """
        Edit the current mouse button mask and send it to the server as a pointer event
        Down=False clears the bits in buttons
        Down=True sets the bits in buttons
        IE calling pointer_event(buttons=[1, 2], down=True) will mark the left and middle mouse buttons as down at (0, 0)
        """
        if x == self.framebuffer.width - 1:
            x -= self._offset
        else:
            x += self._offset
        if y == self.framebuffer.height - 1:
            y -= self._offset
        else:
            y += self._offset

        self._offset ^= 1 # flip offset flag

        if down:
            # do not affect buttons that are already down
            button_mask = 0x00
        else:
            # do not affect buttons that are already up
            button_mask = 0xFF

        # flip the corresponding bits in the mask
        for button in buttons:
            button_mask ^= 1 << (button - 1)
        # apply the mask to the mouse_buttons member
        if down:
            self.mouse_buttons |= button_mask
        else:
            self.mouse_buttons &= button_mask

        logger.debug(self.mouse_buttons)
        # send the current mouse_buttons to the server
        event = struct.pack(POINTER_EVENT, 0x05, self.mouse_buttons, x, y)
        self._safe_send(event)

        Edit the current mouse button mask and send it to the server as a pointer event
        Down=False clears the bits in buttons
        Down=True sets the bits in buttons
        IE calling pointer_event(buttons=[1, 2], down=True) will mark the left and middle mouse buttons as down at (0, 0)
        
Edit the current mouse button mask and send it to the server as a pointer event
Down=False clears the bits in buttons
Down=True sets the bits in buttons
IE calling pointer_event(buttons=[1, 2], down=True) will mark the left and middle mouse buttons as down at (0, 0)
Edit the current mouse button mask and send it to the server as a pointer event Down = False clears the bits in buttons Down = True sets the bits in buttons IE calling pointer_event ( buttons = [ 1 2 ] down = True ) will mark the left and middle mouse buttons as down at ( 0 0 )
def pointer_event(self, buttons=[], down=False, x=0, y=0):
        if x == self.framebuffer.width - 1:
            x -= self._offset
        else:
            x += self._offset
        if y == self.framebuffer.height - 1:
            y -= self._offset
        else:
            y += self._offset
        self._offset ^= 1 
        if down:
            button_mask = 0x00
        else:
            button_mask = 0xFF
        for button in buttons:
            button_mask ^= 1 << (button - 1)
        if down:
            self.mouse_buttons |= button_mask
        else:
            self.mouse_buttons &= button_mask
        logger.debug(self.mouse_buttons)
        event = struct.pack(POINTER_EVENT, 0x05, self.mouse_buttons, x, y)
        self._safe_send(event)
def pointer_event ( self , buttons = [ ] , down = False , x = 0 , y = 0 ) : if x == self . framebuffer . width - 1 : x -= self . _offset else : x += self . _offset if y == self . framebuffer . height - 1 : y -= self . _offset else : y += self . _offset self . _offset ^= 1 if down : button_mask = 0x00 else : button_mask = 0xFF for button in buttons : button_mask ^= 1 << ( button - 1 ) if down : self . mouse_buttons |= button_mask else : self . mouse_buttons &= button_mask logger . debug ( self . mouse_buttons ) event = struct . pack ( POINTER_EVENT , 0x05 , self . mouse_buttons , x , y ) self . _safe_send ( event )
Edit the current mouse button mask and send it to the server as a pointer event
Down=False clears the bits in buttons
Down=True sets the bits in buttons
IE calling pointer_event(buttons=[1, 2], down=True) will mark the left and middle mouse buttons as down at (0, 0)
Edit the current mouse button mask and send it to the server as a pointer event Down = False clears the bits in buttons Down = True sets the bits in buttons IE calling pointer_event ( buttons = [ 1 2 ] down = True ) will mark the left and middle mouse buttons as down at ( 0 0 )
"""
        Edit the current mouse button mask and send it to the server as a pointer event
        Down=False clears the bits in buttons
        Down=True sets the bits in buttons
        IE calling pointer_event(buttons=[1, 2], down=True) will mark the left and middle mouse buttons as down at (0, 0)
        """ # flip offset flag # do not affect buttons that are already down # do not affect buttons that are already up # flip the corresponding bits in the mask # apply the mask to the mouse_buttons member # send the current mouse_buttons to the server
self
buttons
down
x
y