diff options
author | Aki <nthirtyone@gmail.com> | 2016-08-14 23:05:37 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-08-14 23:05:37 +0200 |
commit | 7d4f54ff43c19d590f7dc3fb2803442b4b469ee6 (patch) | |
tree | 72aea93e1f80ec6c80856c54748838503fb15eb8 | |
parent | 1f4b5642739f18185b026a5ad95d66680c8b76c9 (diff) | |
download | roflnauts-7d4f54ff43c19d590f7dc3fb2803442b4b469ee6.zip roflnauts-7d4f54ff43c19d590f7dc3fb2803442b4b469ee6.tar.gz roflnauts-7d4f54ff43c19d590f7dc3fb2803442b4b469ee6.tar.bz2 |
Standardized names
-rw-r--r-- | controller.lua | 20 |
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 |