Remove Roblox script security from GetGamepadCursorPosition and SetGamepadCursorPosition

(these are methods of game.GamepadService)
It’s absolutely silly they are restricted. There is no reason for this.

The only reason I can possibly think of is being tricky and making the user click on something they didn’t mean to, like a purchase button, but the trouble is that you can already do this. Just set the center of any GuiObject to where you want to place the cursor and run game.GamepadService:EnableGamepadCursor(GuiObject)

Simple solution, do not allow the game to change the state or position of the gamepad cursor while there is a purchase window or other funky stuff open.

I reiterate, there is no reason for these two methods to be restricted to CoreScripts.

12 Likes

As much as I agree that they should not be restricted, I think you should probably give some examples of what you intend to do with them if the restrictions are removed (sharing problems is usually better than suggesting solutions).

I decided to write this post when I ran into a roadblock when I was implementing gamepad support for my menus. The project I’m working on has menus that cover both sides of the screen, with significant empty/free space in the middle, and the shoulder buttons would switch to the respective side. You can do this with game.GamepadService:EnableGamepadCursor(GuiObject), but it’s not clean, and the position the cursor moves to can not be based on where it already is. So for now I have opted for placing the cursor in the middle of the element until these restrictions are removed or the API is improved.