'Called when a mouse button is pressed. See pyglet docs for button
amd modifier mappings.
Parameters
x, y : int
The coordinates of the mouse click. Always center of the screen if
the mouse is captured.
button : int
Number representing mouse button that was clicked. 1 = left button,
4 = right button.
modifiers : int
Number representing any modifying keys that were pressed when the
mouse button was clicked.'

def on_mouse_press(self, x, y, button, modifiers):

    if self.exclusive:
        vector = self.get_sight_vector()
        (block, previous) = self.model.hit_test(self.position, vector)
        if ((button == mouse.RIGHT) or ((button == mouse.LEFT) and (modifiers & key.MOD_CTRL))):
            if previous:
                self.model.add_block(previous, self.block)
        elif ((button == pyglet.window.mouse.LEFT) and block):
            texture = self.model.world[block]
            if (texture != STONE):
                self.model.remove_block(block)
    else:
        self.set_exclusive_mouse(True)
