Input Module for the Input Action System IAS

Since the new input instances of roblox release recently i wanted to make a module for it which is easy to use efficient and clean coded.

There’s
:Connect(function):Disconnect()
:SetSetState(Boolean)
:ChangeKeys(NewKeyTable)
.New(Parameters)

Cooldowns, Multiple functions for one Action, Multiple keycode bindings for one function,

Aswell as every Property from the whole table which are changable aswell

Here’s an example on how u can use it

	local NewAction = Input.New(
		"UI",
		"Interact",
		{
			KeyboardBinding = { Enum.KeyCode.E, Enum.KeyCode.F },
			GamepadBinding = { Enum.KeyCode.ButtonY },
			TouchBinding = { MainUI.Hud.Bottom.Shop.TextButton }
		},
		1
	)

	local Connection = NewAction:Connect(function()
		print("Hi")
	end)

	NewAction:ChangeKeys({
		KeyboardBinding = { Enum.KeyCode.T, Enum.KeyCode.G },
	})

	task.wait(2)
	NewAction:SetState(false)
	task.wait(1)
	Connection:Disconnect()

Screenshot 2025-05-22 213718

Here’s the Module

Input Module LINK

Aswell as an explanation (Made it kinda fast)

19 Likes

thats so cool!!
i will 100% try it

3 Likes

Sick,

Does it support multiple keycodes for KeyboardBinding and GamepadBinding? With the example shown, it seems like it isn’t, but also that implementing it would be a breaking change?

Support for TextButtons for mobile would also be nice

3 Likes

What exactly do u mean by multiple keycodes? So u mean like that X and F would work to do it? if so i can add that.

For the Mobile support i will indeed add that soon

1 Like

Yeah, basically something like
{KeyboardBinding = {Enum.KeyCode.E, Enum.KeyCode.F}, GamepadBinding = {Enum.KeyCode.ButtonY}},

This is why I’m saying it would break backwards compatibility, unless you implement it another way, which I don’t think would be as clean

1 Like

Ahh, i’ma add that thanks for telling me ;D

This seems cool, but it seems that it’s lacking the ability to connect multiple functions.

You should add a :Connect() method, that of course connects the given function to the event, and then returns the connection, so that you can disconnect it.

You’d want to get rid of the :ChangeFunc() method and the function parameter in the Input.New constructor.

1 Like

Good idea, i’m gona do that. tbh i didn’t add that before cause i personally prefer how i did it i like it more like that cause for some reason it seems more organized to me but il change it to :Connect since that’s probably what the most people want

1 Like

Added that aswell as Mobile support the problem is i can’t test mobile support but it should work. cause it’s not avaible for public games yet cause it’s not completly out yet

Added the stuff u have said and updated the model. u can also add multiple connections to it so u can run multiple functions

you can try the device emulator in studio. It will act like a touch device, with the mouse acting like a finger, but you only press at one place at a time

1 Like

Ahh, thank youu, i didn’t know u can also test it on that, i thought u can only use it to see the ui :wink: but it works.

1 Like

It’s me or it dosen’t detect mouse clicks?

1 Like

Oh mouse clicks it’s not in Enum.Keycodes, it’s Enum.UserInputType.??? it should work i believe i can’t test it right now

Yh but they added Mouse clicks to keycode for this new system but it’s broken and mouse click only detected by UserInputType

1 Like

Oh, yea it doesn’t work with that, let me try fixing it

Uhm, i can’t find them what are they called Exactly?

I’ve read the some more infos about the IAS and they said they will add Mousebuttons in the future
pretty sure u can’t do it atm

yeah i’ve just used regular UIS for mouse inputs

1 Like

I probably won’t add that since they’re probably gona add a way for it anyways and since in beta u can’t use it yet