本文整理汇总了C#中OuyaSDK.getKeyCode方法的典型用法代码示例。如果您正苦于以下问题:C# OuyaSDK.getKeyCode方法的具体用法?C# OuyaSDK.getKeyCode怎么用?C# OuyaSDK.getKeyCode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OuyaSDK
的用法示例。
在下文中一共展示了OuyaSDK.getKeyCode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleButtonEvent
public static void HandleButtonEvent(OuyaSDK.InputButtonEvent inputEvent)
{
OuyaInputManager.OuyaKeyState keyState = OuyaInputManager.getPlayerKeyState(inputEvent.getPlayer());
if (null == keyState)
{
return;
}
switch (inputEvent.getKeyAction())
{
case OuyaSDK.InputAction.KeyDown:
case OuyaSDK.InputAction.KeyUp:
switch (inputEvent.getKeyCode())
{
case OuyaSDK.KeyEnum.BUTTON_O:
keyState.m_buttonO = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_U:
keyState.m_buttonU = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_Y:
keyState.m_buttonY = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_A:
keyState.m_buttonA = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_LB:
keyState.m_buttonLB = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_LT:
keyState.m_buttonLT = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_L3:
keyState.m_buttonL3 = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_RB:
keyState.m_buttonRB = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_RT:
keyState.m_buttonRT = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_R3:
keyState.m_buttonR3 = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_SYSTEM:
keyState.m_buttonSystem = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_DPAD_DOWN:
keyState.m_buttonDPadDown = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_DPAD_LEFT:
keyState.m_buttonDPadLeft = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_DPAD_RIGHT:
keyState.m_buttonDPadRight = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
case OuyaSDK.KeyEnum.BUTTON_DPAD_UP:
keyState.m_buttonDPadUp = inputEvent.getKeyAction() == OuyaSDK.InputAction.KeyDown;
break;
default:
return;
}
OuyaButtonEvent.buttonPressEvent(inputEvent.getPlayer(), inputEvent.getKeyCode(), inputEvent.getKeyAction());
break;
}
}