local ContextActionService = game:GetService("ContextActionService")
local function Action(actionName, inputState, inputObject)
print(actionName)
end
ContextActionService:BindAction("Up", Action, true, Enum.KeyCode.PageUp)
ContextActionService:BindAction("Down", Action, true, Enum.KeyCode.PageDown)
Pressing PageUp and PageDown will fire the ContextActionService:BindAction and at the same time will move the camera focus up and down.
Publish and play outside Studio. It will work correctly, ie, the camera will not move.
Expected Behavior
The camera should not move when pressing PageUp and PageDown keys
Actual Behavior
Only in Studio, the camera is moving when pressing PageUp and PageDown keys
Issue Area: Studio Issue Type: Other Impact: Moderate Frequency: Constantly
Edit
Also, in Studio, PageUp and PageDown will generate only Enum.UserInputState.End and never Enum.UserInputState.Begin
I have to disagree, because a few months ago these keys were normally captured by Studio and now they aren’t anymore.
And disabling this option will impact other shortcut keys that were used by windows and other support programs I use, like Autohotkey.
Disabling is not the fix, it’s the workaround.
Did you use BindAction or BindActionAtPriority at that point? You can try the latter and see if a sufficiently high priority and then sinking the input avoids the camera movement.
In my old project, about 6 months ago, I only used UserInputService.InputBegan and it was working.
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(Input,GPE)
print (Input.KeyCode)
end)
I stopped the project and recently started another one with the same UserInputService system.
To my surprise, these problems started to happen.
So I tried to migrate to ContextActionService:BindAction and I realized that the same happens, which is why I opened this bug ticket, because it used to work, today it doesn’t.
This isn’t really a bug either? Studio has a specific bindable action for tilting the camera up and down that’s binded to the PageUp and PageDown keys so as intended the camera will be tilted if you press those keys in Studio. The action doesn’t exist on the client and therefore doesn’t do it outside of Studio.
If you’ve disabled the respect Studio shortcut setting and you still find the camera tilts in some cases, then provided you don’t actively use these keys to tilt the camera or anything you can just remove the PageUp and PageDown keys from the binding list so it won’t be actionable.
File → Advanced → Customize Shortcuts → Search for Tilt → Double click the box in the Shortcut column → Right click → Hit Clear Shortcut
You can always restore Studio shortcuts to their defaults or rebind the keys at a later point in time if for whatever reason you’re not comfortable massively changing your Studio bindings and you need a way to revert some but not all bindings.
For third party program concerns, the answer is just to not use keys that conflict with their bindings, change the bindings for that program or your Roblox system or be mindful of what keys another user might have reserved for other tooling. Perhaps you may want to consider adding in a modifiable binding for your experience’s settings too.
In addition to solving this problem, you discovered the cause of this anomaly, being in fact a single keyboard shortcut introduced in some Studio version that probably occurred a few months ago.
Thank you again.