VRCUrlInputField.ActivateInputField() breaks various shortcut keys in VRChat
needs more information
ikuko
VRCUrlInputField.ActivateInputField()
breaks various shortcut keys in VRChat. Mute button (V) and Quick Menu (R) will not work in desktop mode. Similarly in VR mode, the mute button (B button) and quick menu (press and hold B button) will not function. This bug seems to have been introduced in 2022.4.1p2 (build 1260)
.VRCUrlInputField.ActivateInputField()
を実行するとVRChatの様々なショートカットキーを壊す。デスクトップモードではミュートボタン(V)やクイックメニュー(R)が機能しなくなります。VRモードでも同様にミュートボタン(Bボタン)やクイックメニュー(Bボタンの長押し)が機能しなくなります。この不具合は 2022.4.1p2 (build 1260)
から入ったようです。Log In
Phasedragon
needs more information
Phasedragon
This was done intentionally because if you are activating an input field it is supposed to capture your keys. Doing this allows you to more cleanly type into an inputfield without triggering accidental inputs. Is there some situation where this behavior is not desired?
ikuko
Phasedragon: What follows is a world though free public video playback asset.
https://vrchat.com/home/content/worlds/wrld_73864d77-e819-493d-a20e-965b608d0c6e
This asset allows you to easily paste the video URL from the clipboard using the right control key + V key. To achieve this behavior, we use
ActivateInputField()
to force the input field to be active. Also, once you call ActivateInputField()
, the mute button and quick menu buttons will not work after calling DeactivateInputField()
. If there is a way to correctly deactivate the active state, it would be a good behavior as it would prevent triggering incorrect input.Phasedragon
ikuko: I'm not sure how to reproduce this issue. I cannot see where in this world it does ActivateInputField. Additionally, in my own worlds, calling DeactivateInputField has correctly released the input.
Regardless, VRChat has solved this issue by making a keyboard pop up when you click on an inputfield. That keyboard has a paste button on the bottom right. So whatever that world is doing is unnecessary because you no longer need to use ctrl + V to paste in VR.
ikuko
Phasedragon: Thanks for the detailed verification. I have verified it again at my end and found that there are conditions under which it occurs. I have prepared a compact verification world below.
This world uses Udon to call
ActivateInputField()
when the top button is clicked or the right control key is pressed and DeactivateInputField()
when the bottom button is clicked or the right control key is released. when the bottom button is clicked or the right control key is released. What I want you to see is that the behavior was fine when the button was operated by a click. If the right control key was DeactivateInputField()
when operated, it did not work correctly. Please check the attached code implemented by UdonSharp.[AddComponentMenu("")]
[UdonBehaviourSyncMode(BehaviourSyncMode.None)]
public class TEST2 : UdonSharpBehaviour
{
[SerializeField]
VRCUrlInputField inputField;
[SerializeField]
Button activateButton;
[SerializeField]
Button deactivateButton;
private void Start()
{
activateButton.interactable = true;
deactivateButton.interactable = false;
}
// Called from uGUI's Button click event or Update()
public void Activate()
{
Debug.Log("[TEST2] Activate");
inputField.ActivateInputField();
activateButton.interactable = false;
deactivateButton.interactable = true;
}
// Called from uGUI's Button click event or Update()
public void Deactivate()
{
Debug.Log("[TEST2] Deactivate");
inputField.DeactivateInputField();
activateButton.interactable = true;
deactivateButton.interactable = false;
}
private void Update()
{
if (Input.GetKeyDown(KeyCode.RightControl))
{
Activate();
}
if (Input.GetKeyUp(KeyCode.RightControl))
{
Deactivate();
}
}
}