Windows devices with 25H2 (newest probably) version cause issues as ContextActionService:GetButton(actionName) returns the button.
Works on devices which Settings > System > About shows Pen and Touch as Touch support with 10 touch points
Before updating 25H1 to 25H2, ContextActionService:GetButton(actionName) returns nil as expected.
Expected Behaviour: It should return nil.
Which causes glitches because:
It does return nil in studio… But in main game, it returns the button. It is inconsistent.
Many developers also yield until TouchGui.JumpButton if button exists, which also will never exist and brick the script if not modular enough.
Roblox, because of this issue many players have major issues on most games, about special shiftlocks/functions after mobile checks, even roblox chat itself thinks player is mobile! So players with Windows 11 25H2 with the pen and touch thing, cant even send emojis with Button :
Hello, thanks for the report. On PC, it is now possible to switch between touch controls and mouse/keyboard mid-game. In this situation, ContextActionService:GetButton() may return a button, but it may not be visible while the user isn’t currently using touch controls. I would consider it to be working as expected to return a value from GetButton here, because a developer may want to customize the button or query its location, and this should preserve even when the user switches to mouse/keyboard or gamepad, and then back to touch.
For your use case, is it necessary for this to return nil from GetButton? Can you let it handles this case, and if you need to detect if the user is using touch controls, query UserInputService.PreferredInput?
Read “Which causes glitches because:” again, made some more testing with it.
Okay, I see.
Like you said there is ways to overcome this, but many developers do things below which causes problem.
Caused by;
After getting a result from GetButton,
People yield until jumpButton to handle other buttons to scale their buttons related to it.
local dashButton = handleContextActionButtons("Dash"); if dashButton then
ContextActionService:SetTitle("Dash", "Dash")
ContextActionService:SetPosition("Dash", UDim2.new(1, jumpButton.Position.X.Offset - jumpButton.Size.X.Offset/4, 1, jumpButton.Position.Y.Offset - jumpButton.Size.Y.Offset/1.4))
end
People yield until jump button to modify it
People yield until jump button to connect a function related to it.
Which makes players unable to use stuff, if their code is not modular enough.
But, since it does not happen in studio but in real game, like how do you expect them to notice this behaviour?
Today i randomly joined 4 games sir.
Forge, Arcane Odyssey, Divine Duality, Clover Retribution.
None of them had shiftlock except Clover Retribution. Dont worry i have thousands of hours developing, i know all the settings.
Also i can’t send emojis in chat with ‘:’ button, if it is related.
Like i said, again, it seems people don’t know how to handle it.
Why do you guys return the button if PreferredInput is not Touch?
Doesn’t this ruin player experience for touch laptops? My touch monitor is not even connected but even i am getting affected.
Because the button does not get removed if you switch to a different input method, it simply gets hidden.
Games determining input methods by capabilities instead of the user’s actual preferred input is not a problem that Roblox can solve, changing the behavior of ContextActionService:GetButton() now would also result in breaking existing code, as well as a performance regression when changing input methods due to the cost of destroying/creating instances (though likely not significant for most games).
If PreferredInput is incorrect for you, please provide relevant reproduction files/steps, as well as logs.
No, this is false. Only mentioned 25H2 Touch as Touch support with 10 touch points users cannot do it while other users can. (Without being sure, but your explanation has nothing to do with it.)
This just means “we can change it but we are afraid it will cause problems.”
I suggest taking a different approach:
Trying to find the problem.
Here man i will join a random game.
It is called “The Storage” now.
This is what i see on PC:
PreferredInput has not much to do with this. It is correct most of the time. It was just a slight bug while i was debugging the problem. Read the messages pls , this is about GetButton method.
Touch buttons do not get removed if your input method changes:
Please test in a game that you know has ChatInputBarConfiguration.AutocompleteEnabled enabled, as the game you have tested in could have possibly disabled that functionality.
Well, i tried on many games with asking people and receiving answers that they can. Including my game which has that setting enabled.
Also i dont think there is any game other than few that leaves that setting off.
And this is not the main topic
I do not have a Touch device, i use PC…
working as expected does not work if every game is doing it wrong…
Am i not clear enough on what is the bug?
After testing myself using Studio’s device emulator, I can confirm that emoji autocomplete is not available on touch capable devices, I assume this is because most mobile keyboards already have a native emoji feature, but I cannot test if this changes dynamically based on the current input method, you can add this to the bug report.
If you had a touch capable display connected at any point, and have not uninstalled its drivers, then your PC is technically touch capable, as can be seen by Windows Pen & Ink being available on your machine.
Can you test if this still occurs after disabling Windows Pen & Ink?
ContextActionService:GetButton() returning the button while you aren’t using touch controls is intended behavior however.
This only happens on Touch with pen bla bla devices, yes. We tested it with disabled 25H2 version. Yes, it does not happen without it.
I already fixed it in my game with using GetButton with PreferredInput but nearly every game, especially games with complex mechanics, does it wrong.
So basically Touch Laptops cant play most of the games which means this should be fixed.
Also they cant use emoji i guess.
This is a problem on the games’ end then.
There isn’t anything that Roblox can realistically “fix”, but I suppose they could change the behavior of context action buttons to not be created if the user’s input is not touch on initialization, but the issue would still continue if the user uses touch input and changes to keyboard & mouse at any point.
Please provide the reproduction files/steps, and logs for this.
This is not an easy fix as you may think, existing code may rely on the current behavior, where if the button has existed previously, it should always exist onward, allowing for customization.