Input

Keyboard, mouse, gamepad, touch, gestures, file drop.

Input reference

Every raylib input binding across the Keyboard, Mouse, Gamepad, Touch, Gestures, and Files (drop) namespaces.

Keyboard

Keyboard.is_pressed(key: KeyboardKey) -> Bool

Category: Keyboard · raylib: IsKeyPressed(key)

True for exactly one frame on the key-down edge.

if Keyboard.is_pressed(KeyboardKey.SPACE) { -- start game }

raylib cheatsheet · Iron source · Test usage

Keyboard.is_pressed_repeat(key: KeyboardKey) -> Bool

Category: Keyboard · raylib: IsKeyPressedRepeat

True on the key-down edge and on OS-driven key-repeat events. Useful for text editing.

if Keyboard.is_pressed_repeat(KeyboardKey.BACKSPACE) { }

raylib cheatsheet · Iron source · Test usage

Keyboard.is_down / is_released / is_up(key: KeyboardKey) -> Bool

Category: Keyboard · raylib: IsKeyDown / IsKeyReleased / IsKeyUp

is_down: held. is_released: just released (edge). is_up: not held.

if Keyboard.is_down(KeyboardKey.W) { paddle_y = paddle_y - speed }
if Keyboard.is_down(KeyboardKey.S) { paddle_y = paddle_y + speed }

raylib cheatsheet · Iron source · Test usage

Keyboard.get_pressed() -> KeyboardKey

Category: Keyboard · raylib: GetKeyPressed

Pops one key from the pressed-queue. Returns KEY_NULL = 0 when queue empty.

val k = Keyboard.get_pressed()

raylib cheatsheet · Iron source · Test usage

Keyboard.get_char_pressed() -> Int32

Category: Keyboard · raylib: GetCharPressed

Pops one Unicode codepoint from the character-queue (respects keyboard layout, shift, IME). Returns 0 when empty.

val c = Keyboard.get_char_pressed()

raylib cheatsheet · Iron source · Test usage

Keyboard.set_exit_key(key: KeyboardKey)

Category: Keyboard · raylib: SetExitKey

Which key makes Window.should_close() return true (default ESC). Pass KEY_NULL = 0 to disable.

Keyboard.set_exit_key(KeyboardKey.Q)

raylib cheatsheet · Iron source · Test usage

Mouse

Mouse.is_button_pressed / is_button_down / is_button_released / is_button_up(button: MouseButton) -> Bool

Category: Mouse · raylib: IsMouseButton*

Edge vs held predicates for each MouseButton.

if Mouse.is_button_pressed(MouseButton.LEFT) { -- on click }

raylib cheatsheet · Iron source · Test usage

Mouse.get_x / get_y / get_position / get_delta

Category: Mouse · raylib: GetMouseX / Y / Position / Delta

Current mouse position in window space; get_delta is the frame-to-frame delta.

val pos = Mouse.get_position()
val d = Mouse.get_delta()

raylib cheatsheet · Iron source · Test usage

Mouse.set_position(x: Int32, y: Int32) / set_offset(x, y) / set_scale(x, y)

Category: Mouse · raylib: SetMousePosition / SetMouseOffset / SetMouseScale

Warp cursor; apply coordinate offset / scale (useful when window has letterboxing).

Mouse.set_position(Int32(400), Int32(300))

raylib cheatsheet · Iron source · Test usage

Mouse.get_wheel_move() -> Float32

Category: Mouse · raylib: GetMouseWheelMove

Vertical wheel delta for this frame. get_wheel_move_v() returns Vector2 for 2D wheels.

zoom = zoom + Mouse.get_wheel_move() * Float32(0.1)

raylib cheatsheet · Iron source · Test usage

Gamepad

Gamepad.is_available(gamepad: Int32) -> Bool

Category: Gamepad · raylib: IsGamepadAvailable

True if gamepad at slot gamepad (0-3) is connected.

if Gamepad.is_available(Int32(0)) { }

raylib cheatsheet · Iron source · Test usage

Gamepad.get_name(gamepad: Int32) -> String

Category: Gamepad · raylib: GetGamepadName

Human-readable gamepad name from OS/SDL mapping database.

val name = Gamepad.get_name(Int32(0))

raylib cheatsheet · Iron source · Test usage

Gamepad.is_button_pressed / is_button_down / is_button_released / is_button_up(gamepad, button)

Category: Gamepad · raylib: IsGamepadButton*

Edge + held predicates per gamepad slot and GamepadButton.

if Gamepad.is_button_pressed(Int32(0), GamepadButton.RIGHT_FACE_DOWN) { }

raylib cheatsheet · Iron source · Test usage

Gamepad.get_button_pressed() -> GamepadButton

Category: Gamepad · raylib: GetGamepadButtonPressed

Pops one button from the pressed-queue. Useful for rebind-UI.

val b = Gamepad.get_button_pressed()

raylib cheatsheet · Iron source · Test usage

Gamepad.get_axis_count(gamepad) / get_axis_movement(gamepad, axis)

Category: Gamepad · raylib: GetGamepadAxisCount / GetGamepadAxisMovement

Stick / trigger values in [-1, 1] (sticks) or [0, 1] (triggers).

val lx = Gamepad.get_axis_movement(Int32(0), GamepadAxis.LEFT_X)

raylib cheatsheet · Iron source · Test usage

Gamepad.set_mappings(mappings: String) -> Int32

Category: Gamepad · raylib: SetGamepadMappings

Load SDL_GameControllerDB strings (multiple mappings separated by newlines). Returns count loaded.

Gamepad.set_mappings(db_string)

raylib cheatsheet · Iron source · Test usage

Gamepad.set_vibration(gamepad, left_motor, right_motor, duration)

Category: Gamepad · raylib: SetGamepadVibration

Rumble both motors at [0..1] intensity for duration seconds.

Gamepad.set_vibration(Int32(0), Float32(1.0), Float32(1.0), Float32(0.25))

raylib cheatsheet · Iron source · Test usage

Touch

Touch.get_x / get_y / get_position(index) / get_point_id(index) / get_point_count

Category: Touch · raylib: GetTouchX / Y / Position / PointId / PointCount

Multi-touch state (mobile + touch-enabled desktops). Indexed 0..point_count-1.

val n = Touch.get_point_count()
val p = Touch.get_position(Int32(0))

raylib cheatsheet · Iron source · Test usage

Gestures

Gestures.is_detected(gesture: Gesture) -> Bool / Gestures.get_detected() -> Gesture

Category: Gestures · raylib: IsGestureDetected / GetGestureDetected

Query if a specific gesture fired this frame, or get the current one.

if Gestures.is_detected(Gesture.SWIPE_RIGHT) { }

raylib cheatsheet · Iron source · Test usage

Gestures.get_hold_duration / get_drag_vector / get_drag_angle / get_pinch_vector / get_pinch_angle

Category: Gestures · raylib: GetGestureHoldDuration / DragVector / DragAngle / PinchVector / PinchAngle

Gesture-specific continuous data (hold time in seconds, drag Vector2, angles in radians).

val drag = Gestures.get_drag_vector()

raylib cheatsheet · Iron source · Test usage

File drop

Files.is_dropped() -> Bool

Category: File drop · raylib: IsFileDropped

True if the user dragged-and-dropped one or more files onto the window this frame.

if Files.is_dropped() { -- handle drop }

raylib cheatsheet · Iron source · Test usage

Files.load_dropped() -> FilePathList

Category: File drop · raylib: LoadDroppedFiles

Get the dropped paths. Access via FilePathList.get(list, index); remember to Files.unload_dropped(list).

val list = Files.load_dropped()
Files.unload_dropped(list)

raylib cheatsheet · Iron source · Test usage

See also