Ejemplo n.º 1
0
        public bool PollInput(WTKey KeyName, PlayerFlags Player)
        {
            if (lastInputSnapshot.KeyEvents.Count(x => x.Key == KeyName.Convert()) > 0)
            {
                return(lastInputSnapshot.KeyEvents.First(x => x.Key == KeyName.Convert()).Down);
            }
            return(lastInputSnapshot.IsMouseDown(KeyName.ConvertMouse()));

            //return false;
        }
Ejemplo n.º 2
0
        public float PollAxis(WTKey KeyName, PlayerFlags Player)
        {
            if (lastInputSnapshot.KeyEvents.Count(x => x.Key == KeyName.Convert()) > 0)
            {
                return(lastInputSnapshot.KeyEvents.First(x => x.Key == KeyName.Convert()).Down ? 0 : 1);
            }
            if (KeyName == WTKey.MouseX)
            {
                return(lastInputSnapshot.MousePosition.X);
            }
            if (KeyName == WTKey.MouseY)
            {
                return(lastInputSnapshot.MousePosition.Y);
            }

            if (KeyName == WTKey.MouseWheel)
            {
                return(lastInputSnapshot.WheelDelta);
            }


            return(0);
        }