New Service UserInputDevices

Hello there, I’ve been on the Roblox Community since 2017 and started developing in late 2019. I always loved to watch how Roblox Developing evolved. Now that I’m Experienced Scripter in the Roblox Community I have also came up with an idea which could be great for Roblox.

Me personally and other users that use External Devices like Steering Wheel or Joysticks would also like to use these devices on Roblox, there is an way however it isn’t the greatest. People have to download external software which emulates their inputs to an Xbox Controller. I personally think an service for this would be better, so now let’s get to the point.

What will this service do? This Service will be runnable on the Client Scripts primarily and my idea is using some functions you can detect devices user has connected to their device.

Code Examples

local deviceService = game:GetService("UserInputDevices")
for index,device in deviceService:GetConnectedDevices() do
 print(device.Name) -- Example: Logitech G29 Steering Wheel

 device.InputBegan:Connect(function(input,gpe)
  if input.DeviceKey == device.Key.Button0 then
   print("Pressed Button0 on "..device.Name)
  end
 end)

 device.InputChanged:Connect(function(input,gpe)
  if input.DeviceAxis == device.Axis.AxisX then
   print("AxisX Value: ", input.Position)
  end
 end)

 device.InputEnded:Connect(function(input,gpe)
  if input.DeviceKey == device.Key.Button1 then
   print("Button1 Input Ended on "..device.Name)
  end
 end)
end

This sounds like a duplicate of this:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.