Documentation for the Unity C# Library
Loading...
Searching...
No Matches
ControllKeys.cs
Go to the documentation of this file.
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4using UnityEngine.EventSystems;
5
6namespace PixoVR.Login
7{
8 public class ControllKeys : MonoBehaviour, IPointerDownHandler
9 {
10 //[SerializeField]
11 // private KeyboardController keyboardController;
12 private const float doubleClickTime = 0.5f;
13 private static GameObject lastPointerObject = null;
14
15 public void OnPointerDown(PointerEventData eventData)
16 {
17 float timeSinceLastClick = Time.unscaledTime - eventData.clickTime;
18 bool bSameObjectClicked = lastPointerObject == eventData.pointerCurrentRaycast.gameObject;
19
20 if (timeSinceLastClick < doubleClickTime && bSameObjectClicked)
21 {
22 KeyboardController.capsShifted = true;
23 }
24 else
25 {
26 KeyboardController.capsShifted = false;
27 }
28
29 lastPointerObject = eventData.pointerCurrentRaycast.gameObject;
30 }
31 public void OnShift()
32 {
33 KeyboardController.Shifted = !KeyboardController.Shifted;
35 {
36 KeyboardController.Shifted = true;
37 }
38 // KeyboardController.capsShifted = false;
39 }
40 public void OnEnter()
41 {
42
43 }
44 public void OnBackSpace()
45 {
47 }
48 }
49}
void OnPointerDown(PointerEventData eventData)
static GameObject lastPointerObject