class Rosegold::MovementKeys

Defined in:

rosegold/control/movement_keys.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(writable : -> Bool | Nil = nil) #

Decides whether script writes apply; nil allows all. For the physics keys, the script-facing mutators below follow ManualControl#script_write_allowed?: ignored while a controller holds input, and waiting for a pending release.


[View source]

Instance Method Detail

def backward? #

Whether backward is currently pressed.


[View source]
def forward? #

Whether forward is currently pressed.


[View source]
def left? #

Whether left strafe is currently pressed.


[View source]
def none? #

Whether no directional keys are currently pressed.


[View source]
def press(*keys : Key) #

Marks each supplied directional key as pressed.


[View source]
def pressed?(keys : Key) : Bool #

Whether every flag in keys is currently pressed.


[View source]
def release(*keys : Key) #

Clears each supplied directional key while retaining the others.


[View source]
def release_all #

Clears every directional key.


[View source]
def replace(value : Key) : Nil #

Replaces the pressed keys for the physics engine and the manual owner, bypassing the script gate.


[View source]
def right? #

Whether right strafe is currently pressed.


[View source]
def state : Key #

The currently pressed directional keys.


[View source]
def state=(value : Key) #

Sets the pressed keys. Ignored while a manual controller owns input.


[View source]