mirror of
https://github.com/TangentFoxy/baton.git
synced 2025-07-28 02:52:19 +00:00
24 lines
586 B
Lua
24 lines
586 B
Lua
local baton = require 'baton'
|
|
local inspect = require 'inspect'
|
|
|
|
local input = baton.new {
|
|
controls = {
|
|
left = {'key:left', 'axis:leftx-', 'button:dpleft'},
|
|
right = {'key:right', 'axis:leftx+', 'button:dpright'},
|
|
up = {'key:up', 'axis:lefty-', 'button:dpup'},
|
|
down = {'key:down', 'axis:lefty+', 'button:dpdown'},
|
|
action = {'key:x', 'button:a'},
|
|
},
|
|
pairs = {
|
|
move = {'left', 'right', 'up', 'down'}
|
|
},
|
|
joystick = love.joystick.getJoysticks()[1],
|
|
}
|
|
|
|
function love.update(dt)
|
|
input:update()
|
|
end
|
|
|
|
function love.draw()
|
|
love.graphics.print(tostring(input._activeDevice))
|
|
end |