Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • solarus solarus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 222
    • Issues 222
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Solarus Games
  • solarussolarus
  • Issues
  • #1282

Closed
Open
Created Oct 14, 2018 by Alex Gleason@alexgleasonContributor

Controller hat switch axis not detected

I'm using an 8Bitdo controller:

Screenshot_from_2018-10-14_16.22.06

The left analog stick is axis 0 (-left, +right), axis 1 (-up, +down). With the Solarus default config, I can use this to control the hero successfully. The problem comes when trying to use the d-pad. The d-pad is axis 6 (-left, +right), axis 7 (-up, +down).

Solarus does not detect the d-pad at all. This code has no output when pressing the d-pad:

function sol.main:on_joypad_axis_moved(axis, state)
  print(axis, state)
end

The left and right analog sticks do work. Here's what jstest looks like:

Screenshot_from_2018-10-14_16.10.46

It's getting output from the other axis fine.

Screenshot_from_2018-10-14_16.18.10

The d-pad is definitely two axis, not 4 discrete digital inputs, but to sanity check I also used this code and got no output from the d-pad (while ABXY do work):

function sol.main:on_joypad_button_pressed(button)
  print(button)
end

My guess is that Solarus won't deal with high-numbered axis for some reason.

EDIT: The order of the axis doesn't matter. I think it's actually because axis 6/7 are considered hat switches:

Screenshot_from_2018-10-14_16.26.46

Edited Oct 14, 2018 by Alex Gleason
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking