Skip to content

brian.uicontrol.UiEventsListener

brian.uicontrol

UiEventsListener class objects

class UiEventsListener()

KnobEvent class objects

class KnobEvent()

turn_delta

turned_to

is_pressed

just_pressed

just_released

ButtonEvent class objects

class ButtonEvent()

is_pressed

just_pressed

just_released

ButtonsEvent class objects

class ButtonsEvent()

top_left

top_right

bottom_left

bottom_right

any_button

any_button_incl_knob

Button class objects

class Button()

last_button_event

wait_for_press

def wait_for_press(timeout_ms: int = -1) -> bool

Waits for next button press event.

This function is blocking.

Arguments:

  • timeout_ms: Maximum number of milliseconds to wait. If the timeout is negative, the function will wait indefinitely.

Returns:

success: - True: If the desired button event was caught. - False: If the timeout ran out.

wait_for_release

def wait_for_release(timeout_ms: int = -1) -> bool

Waits for next button release event.

This function is blocking.

Arguments:

  • timeout_ms: Maximum number of milliseconds to wait. If the timeout is negative, the function will wait indefinitely.

Returns:

success: - True: If the desired button event was caught. - False: If the timeout ran out.

wait_for_press_and_release

def wait_for_press_and_release(timeout_ms: int = -1) -> bool

Waits for next button press and release event.

This function is blocking.

Arguments:

  • timeout_ms: Maximum number of milliseconds to wait. If the timeout is negative, the function will wait indefinitely.

Returns:

success: - True: If the desired button event was caught. - False: If the timeout ran out.

Knob class objects

class Knob(Button)

last_button_event

wait_for_directional_turn

def wait_for_directional_turn(clockwise: bool, timeout_ms: int = -1) -> bool

Waits for next directional turn of the knob.

This function is blocking.

Arguments:

  • clockwise: Whether to wait for clockwise or counterclockwise turn.
  • timeout_ms: Maximum number of milliseconds to wait. If the timeout is negative, the function will wait indefinitely.

Returns:

success: - True: If the desired button event was caught. - False: If the timeout ran out.

wait_for_any_turn

def wait_for_any_turn(timeout_ms: int = -1) -> bool

Waits for next any turn of the knob.

This function is blocking.

Arguments:

  • timeout_ms: Maximum number of milliseconds to wait. If the timeout is negative, the function will wait indefinitely.

Returns:

success: - True: If the desired button event was caught. - False: If the timeout ran out.

top_left_button

top_right_button

bottom_left_button

bottom_right_button

any_button

any_button_incl_knob

knob

__init__

def __init__()

Initializes a new UiEventsListener class.

knob_event_since_last

def knob_event_since_last() -> KnobEvent

This function will reset just_pressed, just_released fields and turn_delta fields.

Returns:

KnobEvent class of events that happened since last call.

buttons_event_since_last

def buttons_event_since_last() -> ButtonsEvent

This function will reset just_pressed and just_released fields.

Returns:

ButtonsEvent class of events that happened since last call.