Class EventManager

  • All Implemented Interfaces:

    
    public final class EventManager
    
                        

    Handles all events and passes them to the correct components/layouts.

    • Constructor Detail

      • EventManager

        EventManager(PolyUI polyUI)
        Parameters:
        polyUI - The PolyUI instance to use.
    • Method Detail

      • getMouseDown

         final Boolean getMouseDown()

        weather or not the left button/primary click is DOWN (aka repeating)

      • keyTyped

         final Unit keyTyped(Character key)

        This method should be called when a printable key is typed. This key should be mapped to the user's keyboard layout!

      • keyDown

         final Unit keyDown(Keys key)

        This method should be called when a non-printable, but representable key is pressed.

      • keyDown

         final Unit keyDown(Integer code)

        This method should be called when a non-representable key is pressed.

        This is used solely for keybinding, and so the key can be any value, as long as it is consistent, and unique to that key.

      • keyUp

         final Unit keyUp(Keys key)

        This method should be called when a non-printable, but representable key is released.

      • keyUp

         final Unit keyUp(Integer code)

        This method should be called when a non-representable key is released.

        This is used solely for keybinding, and so the key can be any value, as long as it is consistent, and unique to that key.

      • recalculateMousePos

        @ApiStatus.Internal() final Unit recalculateMousePos()

        Internal function that will force the mouse position to be updated.

        Since:

        0.18.5

      • drop

        @ApiStatus.Internal() final Unit drop(Drawable drawable, Boolean withChildren)

        Internal function that will forcefully drop the given drawable from event tracking.

      • clearModifiers

         final Unit clearModifiers()

        Clear the current keyModifiers.

        Since:

        0.20.1

      • processCandidate

        @ApiStatus.Internal() final Drawable processCandidate(Drawable drawable, Float x, Float y)

        Internal method for drawables, tracking it if it does not consume the events.

        This is used for event dispatching.

      • tryFocus

         final Boolean tryFocus(Drawable drawable)

        try to focus a drawable, and return true if it was successful.

      • dispatch

         final Boolean dispatch(Event event)

        Dispatch an event to this PolyUI instance, and it will be given to any tracked drawable.