Loading Assets/Scripts/ClickTest.cs +3 −2 Original line number Diff line number Diff line Loading @@ -6,6 +6,9 @@ public class ClickTest : MonoBehaviour { [SerializeField] private TMP_Text text; private int _presses; private bool _pressed; //VK_OEM_2 = 0xBF | cedilla //https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes private const int Key = 0xBF; private void OnEnable() { Loading @@ -14,12 +17,10 @@ public class ClickTest : MonoBehaviour { private void Update() { if (_pressed && Win32API.GetAsyncKeyState(Key) == 0) { Debug.Log("unpressed"); _pressed = false; return; } if (!_pressed && Win32API.GetAsyncKeyState(Key) != 0) { Debug.Log("pressed"); _presses++; text.text = _presses.ToString(); _pressed = true; Loading Loading
Assets/Scripts/ClickTest.cs +3 −2 Original line number Diff line number Diff line Loading @@ -6,6 +6,9 @@ public class ClickTest : MonoBehaviour { [SerializeField] private TMP_Text text; private int _presses; private bool _pressed; //VK_OEM_2 = 0xBF | cedilla //https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes private const int Key = 0xBF; private void OnEnable() { Loading @@ -14,12 +17,10 @@ public class ClickTest : MonoBehaviour { private void Update() { if (_pressed && Win32API.GetAsyncKeyState(Key) == 0) { Debug.Log("unpressed"); _pressed = false; return; } if (!_pressed && Win32API.GetAsyncKeyState(Key) != 0) { Debug.Log("pressed"); _presses++; text.text = _presses.ToString(); _pressed = true; Loading