LIKO-12
  • Docs
  • Help
  • Blog

›Peripherals

Introduction

  • What is LIKO-12
  • How to install LIKO-12
  • Getting started
  • Your first LIKO-12 program

Peripherals

  • Audio
  • BIOS - Basic Integrated Operating System
  • CPU - Central Processing Unit
  • FDD - Floppy Disk Drive
  • Gamepad
  • GPU - Graphics Processing Unit
  • HDD - Hard Disk Drive
  • Keyboard
  • RAM - Random Access Memory
  • TouchControls - The Touch Gamepad Input
  • WEB

Peripherals' Objects

  • GPU / fontData
  • GPU / image
  • GPU / imageData
  • GPU / quad
  • GPU / spriteBatch
  • WEB / response
Edit

Gamepad

Handles the input of the gamepads.

  • Version: v1.0.0
  • Available since: LIKO-12 v0.6.0
  • Last updated in: LIKO-12 v0.8.0

Methods:


Gamepad._CancelMapping

Erases mapping state.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.6.0
Gamepad._CancelMapping()

Gamepad._GetGUID

Sets mapping state to GUID.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.6.0
Gamepad._GetGUID()

Gamepad._MapButton

Sets mapping state to MapButton.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.6.0
Gamepad._MapButton()

Gamepad._SaveMap

Saves mapping to 'Miscellaneous/GamepadMapping.txt'.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.6.0
Gamepad._SaveMap()

Events:

Please note that the example functions won't be called automatically, there must be some kind of an events handler for CPU.pullEvent, check if the LIKO-12 OS you're using has one.


gamepadaxis

Triggered when the joystick is moved.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _gamepadaxis(joystick, axis)
    --Content run when the event is triggered
end

Arguments:

  • joystick (table): The joystick that was moved.
  • axis (string): The axis is was pushed on (leftx or lefty).

gamepadpressed

A button on the gamepad was pressed.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _gamepadpressed(joystick, button)
    --Content run when the event is triggered
end

Arguments:

  • joystick (table): The joystick with the pressed button.
  • button (string): The name of the pressed button.

gamepadreleased

A button on the gamepad was released.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _gamepadreleased(joystick, button)
    --Content run when the event is triggered
end

Arguments:

  • joystick (table): The joystick with the released button.
  • button (string): The name of the released button.

joystickadded

Triggered when a joystick is connected.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _joystickadded(joystick)
    --Content run when the event is triggered
end

Arguments:

  • joystick (table): The joystick that was added.

joystickaxis

Map the joystick movements.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _joystickaxis(joystick, axis, value)
    --Content run when the event is triggered
end

Arguments:

  • joystick (table): The joystick to map.
  • axis (number): The index to map to.
  • value (number): Value of the axis.

joystickhat

Map the 8-direction hat movements.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0

direction can be: 'd' (down), 'l' (left), 'r' (right), or 'u' (up)

function _joystickhat(joystick, hat, direction)
    --Content run when the event is triggered
end

Arguments:

  • joystick (table): The joystick to map.
  • hat (number): The index to map to.
  • direction (string): Direction to map for.

joystickpressed

Map a button on the joysitck.

  • Available since: Gamepad: v1.0.0, LIKO-12: v0.6.0
  • Last updated in: Gamepad: v1.0.0, LIKO-12: v0.8.0
function _joystickpressed(joystick, button)
    --Content run when the event is triggered
end

Arguments:

  • joystick (table): The joystick with the button.
  • button (string): The button to map.
← FDD - Floppy Disk DriveGPU - Graphics Processing Unit →
  • Methods:
    • Gamepad._CancelMapping
    • Gamepad._GetGUID
    • Gamepad._MapButton
    • Gamepad._SaveMap
  • Events:
    • gamepadaxis
    • gamepadpressed
    • gamepadreleased
    • joystickadded
    • joystickaxis
    • joystickhat
    • joystickpressed
LIKO-12
Docs
Getting Started (or other categories)Guides (or other categories)API Reference (or other categories)
Community
Project Chat (Discord)Twitter
More
BlogGitHubStar
Copyright © 2020 The LIKO-12 Organization