Cleanest way to detect if I'm on Xbox One?

My game is supposed to have content filters on Xbox One, so that it meets the ESRB criteria.
However, as evident from this video, I’m doing something incorrectly, and thats really bad.

Is there a 100% fool-proof way to detect if a user is playing on an Xbox One?
This is what I’m doing at the moment

local keyBoardEnabled = userInput.KeyboardEnabled
if keyBoardEnabled then

while not userInput.GamepadEnabled do

There’s no method to check unfortunately. I’ve asked like twice for a method or property to be added so that I can configure my layouts better, but both times they’ve been shot down (I wish I remember the threads those were from).

Your code snippet is good, unless the person is on a mobile device…or the user hasn’t hooked up a keyboard just yet. In both scenarios, the code will yield indefinitely unless they hook up a gamepad controller to their device/pc.

I really wish we could have properties that match the selections we have on our game configuration page:

game.DeviceType = Console | PC | Mobile | Tablet (or something like this)

My point being this: We shouldn’t have to do hacky/messy things to try and guess the device the user is on when ROBLOX clearly has info on the user’s device. I don’t understand why we can’t have this information exposed to some high level degree.


This is a new hack that I’m about to try, but its unholy.

while not userInput.GamepadEnabled do

while not game:FindFirstChild("OneStatFrame",true) do
	if not userInput.KeyboardEnabled then

Basically, FindFirstChild recursive doesn’t have any check for RobloxLocked, and there is a special frame in the RobloxGui that doesn’t exist unless the user is on Xbox One, called OneStatFrame.
This is kinda risky though, considering how frequently ROBLOX likes to change their UI. Ideally I could check the height of the screen, but I don’t know how consistent that is.

TL;DR - ROBLOX pls give us something for this.

1 Like

Yeah. I think you’re just gonna have to do some weird adhoc thing like this for now. Hopefully I can try to voice more about getting a property added to make this easier.

Made a thread with a more refined and defined feature request for exposing device type.

What valid reason could they have possibly provided for shooting that down…?

“Trust us, you really don’t need that information…”