Skip to content

Mouse

mouse

An singleton object to work with mouse.

Methods

Name Kwargs Description
update events: list | None = None updates mouse state.

Getters

Name ReturnType Description
pos NvVector2 current mouse position.
wheel_y float total vertical scroll value.
left_fdown bool checks if left button is 1 time pressed.
left_down bool checks if left button is pressed.
left_up bool checks if left button is released.
right_fdown bool checks if right button is 1 time pressed.
right_down bool checks if right button is pressed.
right_up bool checks if right button is released.
center_fdown bool checks if middle button is 1 time pressed.
center_down bool checks if middle button is pressed.
center_up bool checks if middle button is released.
any_down bool checks if any button is pressed.
dragging bool checks if user is dragging with left button.
wheel_up bool checks if wheel was scrolled up.
wheel_down bool checks if wheel was scrolled down.

Use case

from nevu_ui import *
import pygame

pygame.init()

window = Window((500, 500), title = "mouse example")

mouse.update()
mouse.left_fdown
mouse.pos
from nevu_ui import *
import pyray

window = Window((500, 500), title = "mouse example", backend = Backend.RayLib)

mouse.update()
mouse.left_fdown
mouse.pos

Created with GGen v1.1.0 for nevu_ui v0.7.5