Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---@class InputService
- local InputService = {}
- local Signal = require("Signal")
- ---KeyCode <number>
- ---IsHeld <boolean>
- InputService.KeyDown = Signal.new()
- ---KeyCode <number>
- InputService.KeyUp = Signal.new()
- ---Character <string>
- InputService.Writing = Signal.new()
- ---MouseButton <number>
- ---X <number>
- ---Y <number>
- InputService.MouseDown = Signal.new()
- ---MouseButton <number>
- ---X <number>
- ---Y <number>
- InputService.MouseUp = Signal.new()
- ---MouseButton <number>
- ---X <number>
- ---Y <number>
- InputService.MouseDrag = Signal.new()
- ---Direction <-1|1>
- ---X <number>
- ---Y <number>
- InputService.MouseScroll = Signal.new()
- ---Text <string>
- InputService.Paste = Signal.new()
- InputService.EventSignals = {
- key = InputService.KeyDown,
- key_up = InputService.KeyUp,
- char = InputService.Writing,
- mouse_click = InputService.MouseDown,
- mouse_up = InputService.MouseUp,
- mouse_drag = InputService.MouseDrag,
- mouse_scroll = InputService.MouseScroll,
- paste = InputService.Paste,
- }
- InputService = setmetatable(InputService, {
- __newindex = function() end,
- __metatable = "Metatable is locked",
- __tostring = function ()
- return "InputService"
- end
- })
- return InputService
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement