InputUtils.lua 1.1 KB

12345678910111213141516171819202122232425262728
  1. ----------------------------------------------------------------------------------------------------
  2. --
  3. -- Copyright (c) Contributors to the Open 3D Engine Project.
  4. -- For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. --
  6. -- SPDX-License-Identifier: Apache-2.0 OR MIT
  7. --
  8. --
  9. --
  10. ----------------------------------------------------------------------------------------------------
  11. -- require with:
  12. -- local inputMultiHandler = require('scripts.utils.components.inpututils')
  13. -- self.inputHandlers = inputMultiHandler.ConnectMultiHandlers{
  14. -- [InputEventNotificationId("jump")] = {
  15. -- OnPressed = function(floatValue) self:JumpPressed(floatValue) end,
  16. -- OnHeld = function(floatValue) self:JumpHeld(floatValue) end,
  17. -- OnReleased = function(floatValue) self:JumpReleased(floatValue) end,
  18. -- },
  19. -- }
  20. -- disconnect from like this:
  21. -- self.inputHandlers:Disconnect()
  22. local inputMultiHandlers = require('scripts.utils.components.MultiHandlers')
  23. return {
  24. ConnectMultiHandlers = inputMultiHandlers(InputEventNotificationBus, InputEventNotificationId),
  25. }