Logo
Public Types | Static Public Member Functions | List of all members
Yukar.Engine.Input Class Reference

Class to get input from mouse/keyboard/gamepad More...

Public Types

enum  StateType { DIRECT , TRIGGER , TRIGGER_UP , REPEAT }
 Status acquisition type More...
 
enum  KeyStates : ulong {
  NONE = 0 , UP = ((ulong)1 << 0) , DOWN = ((ulong)1 << 1) , RIGHT = ((ulong)1 << 2) ,
  LEFT = ((ulong)1 << 3) , DECIDE = ((ulong)1 << 4) , CANCEL = ((ulong)1 << 5) , MENU = ((ulong)1 << 6) ,
  DASH = ((ulong)1 << 7) , JUMP = ((ulong)1 << 8) , CAMERA_VERTICAL_ROT_UP = ((ulong)1 << 9) , CAMERA_VERTICAL_ROT_DOWN = ((ulong)1 << 10) ,
  CAMERA_HORIZONTAL_ROT_CLOCKWISE = ((ulong)1 << 11) , CAMERA_HORIZONTAL_ROT_COUNTER_CLOCKWISE = ((ulong)1 << 12) , CAMERA_ZOOM_IN = ((ulong)1 << 13) , CAMERA_ZOOM_OUT = ((ulong)1 << 14) ,
  CAMERA_POSITION_RESET = ((ulong)1 << 15) , ACTION1 = ((ulong)1 << 16) , ACTION2 = ((ulong)1 << 17) , ACTION3 = ((ulong)1 << 18) ,
  ACTION4 = ((ulong)1 << 19) , ACTION5 = ((ulong)1 << 20) , ACTION6 = ((ulong)1 << 21) , ACTION7 = ((ulong)1 << 22) ,
  ACTION8 = ((ulong)1 << 23) , ACTION9 = ((ulong)1 << 24) , ACTION10 = ((ulong)1 << 25) , TOUCH = ((ulong)1 << 26) ,
  MOUSE_R = ((ulong)1 << 27) , MOUSE_M = ((ulong)1 << 28) , MOUSE_WHEEL = ((ulong)1 << 29) , FAST_FORWARD = ((ulong)1 << 30) ,
  BRAKE = ((ulong)1 << 31) , BACK_GEAR = ((ulong)1 << 32) , VR_CALIBRATION = ((ulong)1 << 33) , VR_SYNC_CAMERA = ((ulong)1 << 34) ,
  AMOUNT
}
 Input state flag More...
 
enum  KeyIndexes {
  NONE = 0 , UP = 1 , DOWN = 2 , RIGHT = 3 ,
  LEFT = 4 , DECIDE = 5 , CANCEL = 6 , MENU = 7 ,
  DASH = 8 , JUMP = 9 , CAMERA_VERTICAL_ROT_UP = 10 , CAMERA_VERTICAL_ROT_DOWN = 11 ,
  CAMERA_HORIZONTAL_ROT_CLOCKWISE = 12 , CAMERA_HORIZONTAL_ROT_COUNTER_CLOCKWISE = 13 , CAMERA_ZOOM_IN = 14 , CAMERA_ZOOM_OUT = 15 ,
  CAMERA_POSITION_RESET = 16 , ACTION1 = 17 , ACTION2 = 18 , ACTION3 = 19 ,
  ACTION4 = 20 , ACTION5 = 21 , ACTION6 = 22 , ACTION7 = 23 ,
  ACTION8 = 24 , ACTION9 = 25 , ACTION10 = 26 , TOUCH = 27 ,
  MOUSE_R = 28 , MOUSE_M = 29 , MOUSE_WHEEL = 30 , FAST_FORWARD = 31 ,
  BRAKE = 32 , BACK_GEAR = 33 , VR_CALIBRATION = 34 , VR_SYNC_CAMERA = 35 ,
  NUM
}
 Input classification type More...
 
enum  GameState {
  NONE = -1 , WALK , MENU , SYSTEM ,
  AMOUNT
}
 Scene tag type More...
 

Static Public Member Functions

static void UpdateFromTool ()
 
static void Initialize (GameMain inGameMain, bool noWaring=false)
 
static void finalize ()
 
static KeyStates GetState (StateType type, GameState gameState=GameState.WALK)
 
static bool IsDownAny (int deviceId)
 
static bool KeyTest (StateType type, KeyStates key, GameState gameState)
 
static float GetAxis (KeyStates keyState, GameState gameState=GameState.WALK, bool useDeadzone=false, bool useAxisThreshold=true)
 
static bool isTouchDown (GameState gameState=GameState.WALK)
 
static bool isTouchUp (GameState gameState=GameState.WALK)
 
static bool isTouchHold (GameState gameState=GameState.WALK)
 
static SharpKmyMath.Vector2 getTouchPos (int id)
 
static void LockMouseCorsor (bool needLock)
 

Detailed Description

Class to get input from mouse/keyboard/gamepad

Member Enumeration Documentation

◆ GameState

Scene tag type

Enumerator
NONE 
WALK 
MENU 
SYSTEM 
AMOUNT 

◆ KeyIndexes

Input classification type

Enumerator
NONE 
UP 
DOWN 
RIGHT 
LEFT 
DECIDE 
CANCEL 
MENU 
DASH 
JUMP 
CAMERA_VERTICAL_ROT_UP 
CAMERA_VERTICAL_ROT_DOWN 
CAMERA_HORIZONTAL_ROT_CLOCKWISE 
CAMERA_HORIZONTAL_ROT_COUNTER_CLOCKWISE 
CAMERA_ZOOM_IN 
CAMERA_ZOOM_OUT 
CAMERA_POSITION_RESET 
ACTION1 
ACTION2 
ACTION3 
ACTION4 
ACTION5 
ACTION6 
ACTION7 
ACTION8 
ACTION9 
ACTION10 
TOUCH 
MOUSE_R 
MOUSE_M 
MOUSE_WHEEL 
FAST_FORWARD 
BRAKE 
BACK_GEAR 
VR_CALIBRATION 
VR_SYNC_CAMERA 
NUM 

◆ KeyStates

Input state flag

Enumerator
NONE 
UP 
DOWN 
RIGHT 
LEFT 
DECIDE 
CANCEL 
MENU 
DASH 
JUMP 
CAMERA_VERTICAL_ROT_UP 
CAMERA_VERTICAL_ROT_DOWN 
CAMERA_HORIZONTAL_ROT_CLOCKWISE 
CAMERA_HORIZONTAL_ROT_COUNTER_CLOCKWISE 
CAMERA_ZOOM_IN 
CAMERA_ZOOM_OUT 
CAMERA_POSITION_RESET 
ACTION1 
ACTION2 
ACTION3 
ACTION4 
ACTION5 
ACTION6 
ACTION7 
ACTION8 
ACTION9 
ACTION10 
TOUCH 
MOUSE_R 
MOUSE_M 
MOUSE_WHEEL 
FAST_FORWARD 
BRAKE 
BACK_GEAR 
VR_CALIBRATION 
VR_SYNC_CAMERA 
AMOUNT 

◆ StateType

Status acquisition type

Enumerator
DIRECT 
TRIGGER 
TRIGGER_UP 
REPEAT 

Member Function Documentation

◆ finalize()

static void Yukar.Engine.Input.finalize ( )
static

◆ GetAxis()

static float Yukar.Engine.Input.GetAxis ( KeyStates  keyState,
GameState  gameState = GameState.WALK,
bool  useDeadzone = false,
bool  useAxisThreshold = true 
)
static

◆ GetState()

static KeyStates Yukar.Engine.Input.GetState ( StateType  type,
GameState  gameState = GameState.WALK 
)
static

◆ getTouchPos()

static SharpKmyMath.Vector2 Yukar.Engine.Input.getTouchPos ( int  id)
static

◆ Initialize()

static void Yukar.Engine.Input.Initialize ( GameMain  inGameMain,
bool  noWaring = false 
)
static

◆ IsDownAny()

static bool Yukar.Engine.Input.IsDownAny ( int  deviceId)
static

◆ isTouchDown()

static bool Yukar.Engine.Input.isTouchDown ( GameState  gameState = GameState.WALK)
static

◆ isTouchHold()

static bool Yukar.Engine.Input.isTouchHold ( GameState  gameState = GameState.WALK)
static

◆ isTouchUp()

static bool Yukar.Engine.Input.isTouchUp ( GameState  gameState = GameState.WALK)
static

◆ KeyTest()

static bool Yukar.Engine.Input.KeyTest ( StateType  type,
KeyStates  key,
GameState  gameState 
)
static

◆ LockMouseCorsor()

static void Yukar.Engine.Input.LockMouseCorsor ( bool  needLock)
static

◆ UpdateFromTool()

static void Yukar.Engine.Input.UpdateFromTool ( )
static