Can `UserInputService:GetStringForKeyCode()` be used to detect if the user is in MacOS or Windows?

I noticed UserInputService:GetStringForKeyCode() when looking through qDevice’s code, and I found out that it can put the keycode it appears on the keyboard. but when qDevice utilizes UserInputService:GetStringForKeyCode() to check if ButtonA is appearing as × or A, as Playstation uses shapes instead of letters for buttons, but I think it can be done for detecting if user is in a Windows and MacOS device, Is it possible?

I usually think it goes by this:

game.UserInputService:GetStringForKeyCode(Enum.KeyCode.LeftAlt)
game.UserInputService:GetStringForKeyCode(Enum.KeyCode.LeftControl)

but when I output it in studio, it doesn’t output anything

Did you try Numlock, Windows, or Menu? Try and use buttons that don’t exist on anything except windows, then try to use buttons that only exist on mac, then compare the results

Disclaimer: i am a professional idiot that has absolutely NO clue what he’s talking about, if this information actually applies, good for you

I am talking about the UserInputService:GetStringForKeyCode() and if it is used to detect if the user is in MacOS or Windows [you know why I am wanting to do that]

I have no clue, but i’m giving you a possible solution to figure out

1 Like

It wouldn’t work to detect the user’s operating system because you can plug a Windows-compatible keyboard into a Mac and vice versa.

You can’t detect what OS a player is in, doing that by memory usage is terribly inefficient and ineffective, and there won’t be any problems for false positives to come up.

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