Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two Feature Requests #27

Open
sysl-dev opened this issue Mar 16, 2023 · 2 comments
Open

Two Feature Requests #27

sysl-dev opened this issue Mar 16, 2023 · 2 comments

Comments

@sysl-dev
Copy link

An option to have it try to reload the joystick selected on a timer (That way if you plug in a remote later it will refresh)

An option to get the current joystick for your current configuration

local baton = require 'baton'

local input = baton.new {
  controls = {
    left = {'key:left', 'key:a', 'axis:leftx-', 'button:dpleft'},
    right = {'key:right', 'key:d', 'axis:leftx+', 'button:dpright'},
    up = {'key:up', 'key:w', 'axis:lefty-', 'button:dpup'},
    down = {'key:down', 'key:s', 'axis:lefty+', 'button:dpdown'},
    action = {'key:x', 'button:a'},
  },
  pairs = {
    move = {'left', 'right', 'up', 'down'}
  },
  joystick = love.joystick.getJoysticks()[1],
}

Something like

input.joystick

or

input:getJoystick()

I'm sure I'll add it at some point, but it never hurts to ask.

@tesselode
Copy link
Owner

To get the joystick, you can just use input.config.joystick. I'll consider automatically polling for joystick changes, but to be honest I haven't been working with LOVE much lately.

@sysl-dev
Copy link
Author

No worries, I've got a work around solved.

Thank you for confirming the input.config table.

Thank you for your work on this library, even if you're not using Love this has made input much easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants