public override bool HandlesKeyDown(Key key)
        {
            suppressNextPress = false;
            if (HandlesAllInput)               // text input bar
            {
                if (key == game.Mapping(KeyBind.SendChat) || key == Key.KeypadEnter ||
                    key == game.Mapping(KeyBind.PauseOrExit))
                {
                    SetHandlesAllInput(false);
                    game.CursorVisible = false;
                    game.Camera.RegrabMouse();
                    game.Keyboard.KeyRepeat = false;

                    if (key == game.Mapping(KeyBind.PauseOrExit))
                    {
                        input.Clear();
                    }
                    input.EnterInput();
                    altText.SetActive(false);

                    chatIndex = game.Chat.Log.Count - chatLines;
                    ScrollHistory();
                }
                else if (key == Key.PageUp)
                {
                    chatIndex -= chatLines;
                    ScrollHistory();
                }
                else if (key == Key.PageDown)
                {
                    chatIndex += chatLines;
                    ScrollHistory();
                }
                else if (game.Server.SupportsFullCP437 &&
                         key == game.Input.Keys[KeyBind.ExtInput])
                {
                    altText.SetActive(!altText.Active);
                }
                else
                {
                    input.HandlesKeyDown(key);
                    UpdateAltTextY();
                }
                return(key < Key.F1 || key > Key.F35);
            }

            if (key == game.Mapping(KeyBind.Chat))
            {
                OpenTextInputBar("");
            }
            else if (key == Key.Slash)
            {
                OpenTextInputBar("/");
            }
            else
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public override bool HandlesKeyDown(Key key)
        {
            suppressNextPress = false;
            if (HandlesAllInput)               // text input bar
            {
                if (key == game.Mapping(KeyBind.SendChat) || key == Key.KeypadEnter || key == game.Mapping(KeyBind.PauseOrExit))
                {
                    SetHandlesAllInput(false);
                    game.CursorVisible = false;
                    game.Camera.RegrabMouse();
                    game.Keyboard.KeyRepeat = false;

                    if (key == game.Mapping(KeyBind.PauseOrExit))
                    {
                        input.Clear();
                    }
                    input.EnterInput();
                    altText.SetActive(false);

                    // Do we need to move all chat down?
                    int resetIndex = game.Chat.Log.Count - chatLines;
                    if (chatIndex != resetIndex)
                    {
                        chatIndex = ClampIndex(resetIndex);
                        ResetChat();
                    }
                }
                else if (key == Key.PageUp)
                {
                    ScrollHistoryBy(-chatLines);
                }
                else if (key == Key.PageDown)
                {
                    ScrollHistoryBy(chatLines);
                }
                else
                {
                    input.HandlesKeyDown(key);
                    UpdateAltTextY();
                }
                return(key < Key.F1 || key > Key.F35);
            }

            if (key == game.Mapping(KeyBind.Chat))
            {
                OpenTextInputBar("");
            }
            else if (key == Key.Slash)
            {
                OpenTextInputBar("/");
            }
            else
            {
                return(false);
            }
            return(true);
        }
 public override bool HandlesKeyDown(Key key)
 {
     RemoveOverwrites();
     if (input.HandlesKeyDown(key))
     {
         return(true);
     }
     return(base.HandlesKeyDown(key));
 }
Esempio n. 4
0
 public override bool HandlesKeyDown(Key key)
 {
     RemoveOverwrites();
     if (key == Key.Escape)
     {
         game.Gui.SetNewScreen(null);
         return(true);
     }
     return(input.HandlesKeyDown(key));
 }
Esempio n. 5
0
        public override bool HandlesKeyDown(Key key)
        {
            suppressNextPress = false;
            if (HandlesAllInput)               // text input bar
            {
                if (key == game.Mapping(KeyBind.SendChat) || key == Key.KeypadEnter || key == game.Mapping(KeyBind.PauseOrExit))
                {
                    SetHandlesAllInput(false);
                    Keyboard.KeyRepeat = false;

                    if (key == game.Mapping(KeyBind.PauseOrExit))
                    {
                        input.Clear();
                    }
                    input.EnterInput();
                    altText.SetActive(false);

                    // Reset chat when user has scrolled up in chat history
                    int defaultIndex = game.Chat.Log.Count - chatLines;
                    if (chatIndex != defaultIndex)
                    {
                        chatIndex = ClampIndex(defaultIndex);
                        ResetChat();
                    }
                }
                else if (key == Key.PageUp)
                {
                    ScrollHistoryBy(-chatLines);
                }
                else if (key == Key.PageDown)
                {
                    ScrollHistoryBy(chatLines);
                }
                else
                {
                    input.HandlesKeyDown(key);
                    UpdateAltTextY();
                }
                return(key < Key.F1 || key > Key.F35);
            }

            if (key == game.Mapping(KeyBind.Chat))
            {
                OpenInput("");
            }
            else if (key == Key.Slash)
            {
                OpenInput("/");
            }
            else
            {
                return(false);
            }
            return(true);
        }
Esempio n. 6
0
 public override bool HandlesKeyDown(Key key)
 {
     if (input != null)
     {
         if (input.HandlesKeyDown(key))
         {
             return(true);
         }
         if (key == Key.Enter || key == Key.KeypadEnter)
         {
             EnterInput(); return(true);
         }
     }
     return(base.HandlesKeyDown(key));
 }
 public override bool HandlesKeyDown(Key key)
 {
     if (key == Key.Escape)
     {
         game.Gui.SetNewScreen(null);
         return(true);
     }
     else if ((key == Key.Enter || key == Key.KeypadEnter) && input != null)
     {
         ChangeSetting();
         return(true);
     }
     if (input == null)
     {
         return(key < Key.F1 || key > Key.F35);
     }
     return(input.HandlesKeyDown(key));
 }