Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • joeylib joeylib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 11
    • Issues 11
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Public Skunkworks
  • joeylibjoeylib
  • Wiki
  • JoeyLib Gamepad Functions

Last edited by Scott Duensing Oct 17, 2019
Page history

JoeyLib Gamepad Functions

Controller input on classic 16 bit computers is fairly limited. JoeyLib abstracts to a common API as best as it can. More details will be coming as the Amiga and ST backends are completed.

jlGameGetAxis

jint16 jlGameGetAxis(byte which);

Returns a value between -128 and 127 with 0 representing the centered position. Axis 0 is the horizontal (X) axis and axis 1 is the vertical (Y) axis. On systems with analog controllers, the result will vary depending on how far the axis has moved off center. You will need to take into account a small "dead zone" for sticks that do not have a precise center position. On platforms with more than one analog stick, JoeyLib uses the left-hand stick. If the platform supports more than one controller, all connected controllers at application startup will be used.

jlGameGetButton

bool jlGameGetButton(byte which);

Most platforms support two or more buttons. JoeyLib limits button input to two. How to handle platforms with a single button has yet to be decided.

Clone repository
  • Installation
  • JoeyLib API
  • JoeyLib Concepts
  • JoeyLib Data Types
  • JoeyLib Definitions
  • JoeyLib Display Functions
  • JoeyLib Drawing Functions
  • JoeyLib Enumerations
  • JoeyLib Formats
  • JoeyLib Gamepad Functions
  • JoeyLib Keyboard Functions
  • JoeyLib Memory Functions
  • JoeyLib Palette Functions
  • JoeyLib Sound Functions
  • JoeyLib Static Image Functions
View All Pages