Inputs in plugins

I’m questioning what an optimal way of doing inputs in plugins is.

Legacy Surface Tool uses Mouse.KeyUp, however thats deprecated and probably not supported.

PluginMouse.KeyUp:Connect(function(k)
	if string.byte(k) == 27 then --(Escape)
		plugin:Deactivate()
	end
end)

I’ve tried ContextActionService and UserInputService however they dont work within the server datamodel. There was a feature request tieing this all up.

(This is more of a discussion than a question).

1 Like

You can use PluginActions.

This is a question of inputs without needing the user to bind anything beforehand.

PluginActions are for user-facing inputs and cant have a keybind set when they’re created.

Actions actually have a property called DefaultShortcut but it cant be used by developers.

The code above is used to dismissing the tool.

There’s no way to do it properly with no bugs other than plugin actions. I might be wrong tho