文档

Unity Engine

Unity Engine

keyCode

The key code.
阅读时间1 分钟最后更新于 1 个月前

Definition

public KeyCode keyCode { get; protected set; }

Remarks

This is the code of the physical key that was pressed. It doesn't take into account the keyboard layout, and it displays modifier keys, since a key was pressed. For example, pressing the "A" key will cause this property to return KeyCode.A regardless of whether the Shift key is pressed or not. The Shift key itself returns KeyCode.LeftShift since it is a physical key on the keyboard.