AudioAsset
Ease
FastString
FontAsset
NineSlice
PackedSprite
PackedSpriteID
RB
   HardwareSettings
   IRetroBlitGame
RBAsset
Rect2i
ShaderAsset
SoundReference
SpriteGrid
SpriteSheetAsset
TMXMapAsset
   TMXLayer
   TMXLayerLoadState
   TMXObject
   TMXObjectGroup
   TMXProperties
Vector2i

RB.KeyPressed

Method  -  Static

public static bool KeyPressed(KeyCode keyCode, int repeatRate = 0)

Parameters

keyCode KeyCode Key code
repeatRate int Key repeat rate in frames, if > 0 then the button will re-trigger at this repeat rate

Returns

bool

True if key pressed

Description

Return true if given key specified by keyCode went from an up to down state since last call to IRetroBlitGame.Update.

Example

void Update() {
    if (RB.KeyPressed(UnityEngine.KeyCode.Z)) {
        DrinkPotion();
    }
}

See Also

RB.KeyReleased
RB.KeyDown
RB.InputString

See Docs

Features - Keyboard