Keyboard
keyboard
An singleton object to work with keyboard.
Methods
| Name | Kwargs | Description |
|---|---|---|
update |
None |
updates keyboard state. |
is_fdown |
key_code: Keys |
checks if key is 1 time pressed. |
is_down |
key_code: Keys |
checks if key is pressed. |
is_up |
key_code: Keys |
checks if key is released. |
Use case
from nevu_ui import *
import pygame
pygame.init()
window = Window((500, 500), title = "keyboard example")
keyboard.update()
keyboard.is_fdown(Keys.A)
from nevu_ui import *
import pyray
window = Window((500, 500), title = "keyboard example", backend = Backend.RayLib)
keyboard.update()
keyboard.is_fdown(Keys.A)
Created with GGen v1.1.0 for nevu_ui v0.7.5