Gamepad Virtual Cursor: APIs

An update seems to have changed how the controller mouse icon behaves. I can no longer disable the Controller Mouse Icon via “UserInputService.MouseIconEnabled = false”.
image

6 Likes

Hi, thanks for the report. This will be fix in an upcoming release.

5 Likes

Hi, any update on when this upcoming release will be? :smile: Having obtrusive UI I can’t turn off is really hurting my experience.

3 Likes

Hi! This issue should be resolved. Please let me know if you encounter it again. Thanks

2 Likes

Whenever the cursor is activated, the camera zooms out slightly.
This happens in my game when I use a keyboard keycode (Enum.Keycode.O) to activate the cursor since I do not have a controller.

4 Likes

Hello @NoUniqueAddress,

I was wondering if a speed property could be added to the API. We can set the location/position of the Virtual Cursor, and it slows down when it hovers over buttons, but there doesn’t seem to be a way to set the movement speed of the Virtual Cursor.

I feel like the speed currently is fine, and should be the default, but some may want to set it to be faster or slower.

This doesn’t necessarily effect me currently, but it would be a nice addition to those who would use it. I didn’t think of this use-case, rather it came from @SnowzBunz: https://devforum.roblox.com/t/whats-stopping-you-from-supporting-xbox-controllers-console-in-general-is-it-challenging-or-confusing/2392800/30

I’m also wondering if the Virtual Cursor will work with the DragDetectors that’s being worked on.

Thanks,
Reditect

3 Likes

Another thing, I’d like to make a setting in my game to toggle the Virtual Cursor overall. Like, change the VirtualCursorMode itself based on user input like what I’m trying to do in the following image:

image
ignore that it’s under my settings menus graphics tab, it’s supposed to be under ‘general’.

I can toggle the cursor itself, but I can’t, from when the game runs, let the player themselves choose to switch between the Virtual Cursor and the older navigation system.


Until I can toggle between the two, I’m forcing users to adapt to something they might not be comfortable with. :person_shrugging: An alternative would be to have a setting in the Roblox settings menu, but I’d still like the functionality in my own menu as well.

4 Likes

Hi! Enum.KeyCode.O is bound to zoom out. You can see these binds in the help page on the settings menu.

6 Likes

Hi, there are no plans to expose a way to set the speed of the virtual cursor.

Virtual cursor should work with drag detectors yes.

5 Likes

Virtual cursor mode was not designed to be set by users. Generally, virtual cursor was meant to be a drop in replacement to get gamepad support on consoles. That being said, if you really want to let the users choose, you’d have to do a bit of scripting. Here’s an idea:

  • Enable virtual cursor for your experience
  • If your user has virtual cursor set in the options, don’t change anything
  • If your user has virtual cursor off, listen for Enum.KeyCode.ButtonSelect, disable the gamepad cursor and use this api to put the user in the older navigation mode.

Please note that this is an unsupported and not recommended flow.

7 Likes

Ah I see, thank you. Also, I’ve decided to not use the Gamepad Virtual Cursor due to many issues being present in my game with it (eg. someone said that the button to activate the controller was the same as the jump button on their controller)

I don’t have any controllers so I can’t really do the testing myself, I’d suggest making a method to emulate controller input in studio, as it’ll help a lot.

1 Like

Thank you for pushing this update, it’s very very nice
I encountered 2 issues that are quite irritating to deal with; attached is a video with more explanation

  1. camera rotation inputs persist after entering virtual cursor mode, and cannot be escaped until cursor mode is exited and a new camera (R3) input is given
  2. the white dot lags when low-magnitude L3 input is given

Thank you and I hope this gets fixed in the near future!!

3 Likes

@NoUniqueAddress The Issue has returned :frowning:

3 Likes

Hi! Thanks for the report, this should be fixed now.

1 Like

This is awesome! How do I hide the small circle on the top of the screen when not using the cursor? UserInputService.MouseIconEnabled = false works good, but is there a different method? Because I wouldn’t wan’t to disable the mouse on the controller, and then have someone try to use a mouse and not have a mouse icon.

Kinda just trying to keep this thread alive incase someone else needs to ask a question lol.

Hi! Unfortunately, the API you mentioned, UserInputService.MouseIconEnabled = false is the only way currently to disable the dot cursor. I understand the need to show the curser again if the user uses a mouse, I can suggest a script like this to handle this transition gracefully.

local userInputService = game.UserInputService

userInputService.LastInputTypeChanged:Connect(function(lastInputType)
	if (lastInputType == Enum.UserInputType.Gamepad1) then
		userInputService.MouseIconEnabled = false
	else
		userInputService.MouseIconEnabled = true
	end
end)

Note that this only accounts for Enum.UserInputType.Gamepad1, and not gamepads 2-8. Thanks!

1 Like

I am using the Virtual Cursor in my game: “Studio Lite” (Studio Lite - Roblox). It is PC, mobile and Xbox friendly.
But I have one complaint when using an Xbox. The GUI that gets selected for focus is the one closest to the edge of the Virtual Cursor circle, instead of the center. So, when it IsTenFootInterface, I have to spread out my GUI objects so the selected object is not close to the edge of another gui. It would be a huge improvement If the target priority could be the center of the cursor circle. Then if no GUI is in the center, look at the edges.
You can see an example of the problem in “Studio Lite”: Just click the Tutorial button, it will show 6 tutorials: BASICS, BUILD, etc. Point the Virtual cursor at BASICS. If any small edge of the cursor circle touches the BUILD button, then that is what gets highlighted. It is so easy to accidentally select BUILD, when you think you are pointing at BASICS.
I am very happy with the fact that the Virtual Cursor can select and drag Handles and ArcHandles adornments for my Move, Scale and Rotate tools. That is something the old Xbox selection method could not do.

Any way to possibly change the size of the cursor? If there isn’t, any time estimate on possibly adding some API for that?

2 Likes

How do we read the screen position of the virtual cursor? (Looking for what would be equivalent to the a MouseButton1 or MouseMovement InputObject position)

Edit: It’s UserInputService’s GetMouseLocation, should have figured

2 Likes

Tested this out myself and, I’m currently unsure of an answer but it seems that the actual part that decides what you’re hovering over has priority at the bottom of the cursor. Of course, I could be wrong but after testing this for 15 minutes, it could be a possible answer.

edit: Just tested it with a ScrollingFrame and I am completely right, it appears to only select things when the BOTTOM of the cursor is on the item you’re trying to select.