Esempio n. 1
0
        public void OnKeyDown(object sender, KeyEventArgs e)
        {
            menuPool.ResetKey(NativeUI.UIMenu.MenuControls.Up);
            menuPool.ResetKey(NativeUI.UIMenu.MenuControls.Down);
            menuPool.ResetKey(NativeUI.UIMenu.MenuControls.Left);
            menuPool.ResetKey(NativeUI.UIMenu.MenuControls.Right);
            menuPool.ResetKey(NativeUI.UIMenu.MenuControls.Select);
            menuPool.ResetKey(NativeUI.UIMenu.MenuControls.Back);

            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Up, GTA.Control.PhoneUp);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Down, GTA.Control.PhoneDown);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Left, GTA.Control.PhoneLeft);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Right, GTA.Control.PhoneRight);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Select, GTA.Control.PhoneSelect);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Back, GTA.Control.PhoneCancel);

            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Up, Keys.NumPad8);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Down, Keys.NumPad2);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Left, Keys.NumPad4);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Right, Keys.NumPad6);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Select, Keys.NumPad5);
            menuPool.SetKey(NativeUI.UIMenu.MenuControls.Back, Keys.NumPad0);

            menuPool.ProcessKey(e.KeyCode);

            OnKeysDownEvent?.Invoke(e.KeyCode);
        }