Relevant

Subclasses or lambdas determine whether a user key input is relevant or not. They should also provide a way for actively determining if they are pressed, though this behavior is deferred.

Author

fzzyhmstrs

Since

0.6.0

Inheritors

Functions

Link copied to clipboard
open fun isPressed(): Boolean

Determines if the key is relevant in this instant (is being pressed right now)

Link copied to clipboard
open fun needsAlt(): Boolean

Whether this needs the alt key to be pressed to be relevant. Should only return true if it definitely needs it, not "can have it"

Link copied to clipboard
open fun needsCtrl(): Boolean

Whether this needs the control key to be pressed to be relevant. Should only return true if it definitely needs it, not "can have it"

Link copied to clipboard
open fun needsShift(): Boolean

Whether this needs the shift key to be pressed to be relevant. Should only return true if it definitely needs it, not "can have it"

Link copied to clipboard
abstract fun relevant(inputCode: Int, ctrl: Boolean, shift: Boolean, alt: Boolean): Boolean

Determines whether this is relevant to the user inputs provided. In general, only the state you care about should be checked. For example, if your keybind is "X", check that the inputCode is correct but ignore ctrl/shift/alt entirely, unless it is specifically important that they not be pressed.