summaryrefslogtreecommitdiffhomepage
path: root/controller.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-08-14 23:05:37 +0200
committerAki <nthirtyone@gmail.com>2016-08-14 23:05:37 +0200
commit7d4f54ff43c19d590f7dc3fb2803442b4b469ee6 (patch)
tree72aea93e1f80ec6c80856c54748838503fb15eb8 /controller.lua
parent1f4b5642739f18185b026a5ad95d66680c8b76c9 (diff)
downloadroflnauts-7d4f54ff43c19d590f7dc3fb2803442b4b469ee6.zip
roflnauts-7d4f54ff43c19d590f7dc3fb2803442b4b469ee6.tar.gz
roflnauts-7d4f54ff43c19d590f7dc3fb2803442b4b469ee6.tar.bz2
Standardized names
Diffstat (limited to 'controller.lua')
-rw-r--r--controller.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/controller.lua b/controller.lua
index f49b839..ec9552e 100644
--- a/controller.lua
+++ b/controller.lua
@@ -31,10 +31,10 @@ function Controller.testSets(key, joystick)
for i,set in pairs(Controller.sets) do
local action = Controller.testControl(set, key, joystick)
if action ~= nil then
- return set, action, key
+ return set, action
end
end
- return nil, nil, key
+ return nil, nil
end
-- Tests given set if it has controll assigned to given key and joystick.
@@ -64,25 +64,25 @@ function Controller.joystickadded(joystick)
end
-- Gamepad input callbacks
-function Controller.gamepadpressed(joystick, button)
- local set, action, key = Controller.testSets(button, joystick)
+function Controller.gamepadpressed(joystick, key)
+ local set, action = Controller.testSets(key, joystick)
print("Pressed:", set, action, key)
Controller.controlpressed(set, action, key)
end
-function Controller.gamepadreleased(joystick, button)
- local set, action, key = Controller.testSets(button, joystick)
+function Controller.gamepadreleased(joystick, key)
+ local set, action = Controller.testSets(key, joystick)
print("Released:", set, action, key)
Controller.controlreleased(set, action, key)
end
-- Keyboard input callbacks
-function Controller.keypressed(button)
- local set, action, key = Controller.testSets(button, nil)
+function Controller.keypressed(key)
+ local set, action = Controller.testSets(key, nil)
print("Pressed:", set, action, key)
Controller.controlpressed(set, action, key)
end
-function Controller.keyreleased(button)
- local set, action, key = Controller.testSets(button, nil)
+function Controller.keyreleased(key)
+ local set, action = Controller.testSets(key, nil)
print("Released:", set, action, key)
Controller.controlreleased(set, action, key)
end \ No newline at end of file