Unity键盘鼠标监听事件
2017-06-22 14:45
926 查看
using System.Collections; using System.Collections.Generic; using UnityEngine; public class C_3_8_1 : MonoBehaviour { // Use this for initialization void Start () { } // Update is called once per frame void Update () { // 按下键盘A键 if (Input.GetKeyDown(KeyCode.A)){ Debug.Log ("你按下了A"); } // 按住键盘A键 if (Input.GetKey(KeyCode.A)) { Debug.Log ("你按住了A"); } // 抬起键盘A键 if (Input.GetKeyUp(KeyCode.A)) { Debug.Log ("你抬起了A"); } // 按下键盘左Shift键 if (Input.GetKeyDown(KeyCode.LeftShift)) { Debug.Log ("你按下了左Shift"); } // 按住键盘左Shift键 if (Input.GetKey(KeyCode.LeftShift)) { Debug.Log ("你按住了左Shift"); } // 按下键盘左Shift键 if (Input.GetKeyUp(KeyCode.LeftShift)) { Debug.Log ("你抬起了左Shift"); } // 按下鼠标左键 if (Input.GetMouseButtonDown(0)) { Debug.Log ("你按下了鼠标左键"); } // 按住鼠标左键 if (Input.GetMouseButton(0)) { Debug.Log ("你按住了鼠标左键"); } // 抬起鼠标左键 if (Input.GetMouseButtonUp(0)) { Debug.Log ("你抬起了鼠标左键"); } } }
相关文章推荐
- 鼠标和键盘的事件监听
- Java基础--Java---IO流------GUI(布局)、Frame、事件监听机制、窗体事件、Action事件、鼠标事件、对话框Dialog、键盘事件、菜单
- unity一些键盘鼠标特殊触发事件总结
- Python利用pyHook实现监听用户鼠标与键盘事件
- pyhook监听鼠标事件和键盘事件
- 事件 鼠标监听和键盘监听
- pyhook监听鼠标事件和键盘事件
- 如何在ArcMap中监听键盘鼠标事件(转)
- js监听鼠标点击和键盘点击事件并自动跳转页面
- Google Maps API 进级:监听键盘鼠标事件 加载KML或者GEORSS文档
- Node监听鼠标键盘事件,定时发消息小程序,解决robotjs不支持输入汉字问题!
- python2 监听模拟鼠标键盘事件
- 「Unity」键盘、鼠标,检测按键输入事件
- Java_基础—GUI(窗体/鼠标/键盘/动作监听和键盘事件)
- linux c/c++监听鼠标或键盘事件
- Python2.7: 使用Pyhook模块监听鼠标键盘事件-获取坐标
- 用Python监听鼠标和键盘事件
- 通过监听Windows消息实现控件的键盘和鼠标事件路由
- DOM事件监听:键盘和鼠标
- 如何在ArcMap中监听键盘鼠标事件