Commit 14fdd455 authored by Gerard Gascón's avatar Gerard Gascón
Browse files

cleanup

parent 680481af
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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() {
@@ -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;