예제 #1
0
 void M_Input_OnKeyUp(object sender, KeyArgs e)
 {
     if (e.Key == Microsoft.Xna.Framework.Input.Keys.Escape)
     {
         Pause();
     }
 }
예제 #2
0
 public void HandleKey(KeyArgs key)
 {
     if (m_bEnabled && key.Key == Keys.Space)
     {
         m_bChecked = !m_bChecked;
     }
 }
예제 #3
0
 public void HandleKey(KeyArgs key)
 {
     if (m_bEnabled && key.Key == Microsoft.Xna.Framework.Input.Keys.Space)
     {
         m_bChecked = !m_bChecked;
     }
 }
예제 #4
0
 private void IC_OnKeyUp(object sender, KeyArgs e)
 {
     if (m_SignInDialog != null)
     {
         m_SignInDialog.HandleKeyUp(e);
     }
 }
예제 #5
0
 public void HandleKey(KeyArgs key)
 {
     if (m_Input.Focused)
     {
         m_Input.HandleKey(key);
     }
 }
예제 #6
0
 public bool OnKeyUp(KeyArgs e)
 {
     if (e.Key == Keys.Escape)
     {
         return(false);
     }
     return(true);
 }
예제 #7
0
 public bool OnKeyDown(KeyArgs key)
 {
     if (key.Key == Keys.Escape)
     {
         SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuCancel);
         return(false);
     }
     return(true);
 }
예제 #8
0
        public void HandleKeyUp(KeyArgs key)
        {
            UIInputField focused = null;

            if (m_Email.Focused)
            {
                focused = m_Email;
            }
            else if (m_Password.Focused)
            {
                focused = m_Password;
            }
            else if (m_Password2.Focused)
            {
                focused = m_Password2;
            }
            if (focused != null)
            {
                if (key.Key == Keys.Enter)
                {
                    if (focused != m_Password2)
                    {
                        NextFocus();
                    }
                    else
                    {
                        VirtualKeyboard.Hide();
                        if (OnSignIn != null)
                        {
                            OnSignIn(this, null);
                        }
                    }
                }
                else if (key.Key == Keys.Tab)
                {
                    NextFocus();
                    Happiness.Game.SoundManager.PlaySound(SoundManager.SEInst.MenuNavigate);
                }
                else
                {
                    focused.HandleKey(key);
                }
            }
        }
예제 #9
0
 public void HandleKey(KeyArgs key)
 {
     if (key.Key == Keys.Back)
     {
         if (m_szInputText.Length > 0)
         {
             m_szInputText  = m_szInputText.Substring(0, m_szInputText.Length - 1);
             m_szMaskedText = m_szMaskedText.Substring(0, m_szInputText.Length);
         }
     }
     else
     {
         char c = KeyToAscii(key);
         if (c != 0)
         {
             m_szInputText  += c;
             m_szMaskedText += "*";
         }
     }
 }
예제 #10
0
 void M_Input_OnKeyUp(object sender, KeyArgs e)
 {
     if (m_MessageBox != null)
     {
     }
     else if (m_CoinsDialog != null)
     {
         if (!m_CoinsDialog.OnKeyDown(e))
         {
             m_CoinsDialog = null;
         }
     }
     else if (m_EndScreen != null)
     {
     }
     else if (m_PauseMenu != null)
     {
         if (e.Key == Keys.Escape)
         {
             SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuCancel);
             UnPause();
         }
     }
     else if (m_GamePanel.CellDialog != null)
     {
         if (!m_GamePanel.CellDialog.OnKeyUp(e))
         {
             m_GamePanel.CloseCellDialog();
             SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuCancel);
         }
     }
     else
     {
         if (e.Key == Keys.Escape)
         {
             SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuAccept);
             Pause();
         }
     }
 }
예제 #11
0
 private void IC_OnKeyDown(object sender, KeyArgs e)
 {
     if (m_FloorSelect != null)
     {
         if (!m_FloorSelect.OnKeyDown(e))
         {
             m_FloorSelect = null;
         }
     }
     else if (m_CoinsDialog != null)
     {
         if (!m_CoinsDialog.OnKeyDown(e))
         {
             m_CoinsDialog = null;
         }
     }
     else
     {
         if (e.Key == Keys.Escape)
         {
             DoExit();
         }
     }
 }
예제 #12
0
 protected void Invoke_OnKeyRepeat(object sender, KeyArgs args)
 {
     OnKeyRepeat?.Invoke(sender, args);
 }
예제 #13
0
        public void HandleKeyUp(KeyArgs key)
        {
            UIInputField focused = null;

            if (m_Email.Focused)
            {
                focused = m_Email;
            }
            else if (m_Password.Focused)
            {
                focused = m_Password;
            }
            else if (m_Password2.Focused)
            {
                focused = m_Password2;
            }
            if (focused != null)
            {
                if (key.Key == Keys.Enter)
                {
                    if (OnSignIn != null)
                    {
                        OnSignIn(this, null);
                    }
                }
                else if (key.Key == Keys.Tab)
                {
                    if (m_Email.Focused)
                    {
                        m_Email.Focused     = false;
                        m_Password.Focused  = true;
                        m_Password2.Focused = false;
                    }
                    else if (m_Password.Focused)
                    {
                        if (m_bEmailCreate)
                        {
                            m_Email.Focused     = false;
                            m_Password.Focused  = false;
                            m_Password2.Focused = true;
                        }
                        else
                        {
                            m_Email.Focused     = true;
                            m_Password.Focused  = false;
                            m_Password2.Focused = false;
                        }
                    }
                    else if (m_Password2.Focused)
                    {
                        m_Email.Focused     = true;
                        m_Password.Focused  = false;
                        m_Password2.Focused = false;
                    }
                    Happiness.Game.SoundManager.PlaySound(SoundManager.SEInst.MenuNavigate);
                }
                else
                {
                    focused.HandleKey(key);
                }
            }
        }
예제 #14
0
 protected void Invoke_OnKeyUp(object sender, KeyArgs args)
 {
     OnKeyUp?.Invoke(sender, args);
 }
예제 #15
0
        char KeyToAscii(KeyArgs key)
        {
            int keyInt = (int)key.Key;

            if (keyInt >= '0' && keyInt <= '9')
            {
                if (key.Shift)
                {
                    return(Constants.Ascii0to9Shift[keyInt - '0']);
                }
                else
                {
                    return((char)keyInt);
                }
            }
            else if (keyInt >= 'A' && keyInt <= 'Z')
            {
                if (!key.Shift)
                {
                    keyInt -= 'A';
                    keyInt += 'a';
                    return((char)keyInt);
                }
                else
                {
                    return((char)keyInt);
                }
            }
            else if (key.Key == Keys.OemPeriod)
            {
                return((key.Shift) ? '>' : '.');
            }
            else if (key.Key == Keys.OemQuestion)
            {
                return((key.Shift) ? '?' : '/');
            }
            else if (key.Key == Keys.OemComma)
            {
                return((key.Shift) ? '<' : ',');
            }
            else if (key.Key == Keys.OemPipe)
            {
                return(key.Shift ? '|' : '\\');
            }
            else if (key.Key == Keys.OemCloseBrackets)
            {
                return(key.Shift ? '}' : ']');
            }
            else if (key.Key == Keys.OemOpenBrackets)
            {
                return(key.Shift ? '{' : '[');
            }
            else if (key.Key == Keys.OemPlus)
            {
                return(key.Shift ? '+' : '=');
            }
            else if (key.Key == Keys.OemMinus)
            {
                return(key.Shift ? '_' : '-');
            }
            else if (key.Key == Keys.OemMinus)
            {
                return(key.Shift ? '~' : '`');
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("KeyToAscii: " + key.Key.ToString());
            }

            return((char)0);
        }
예제 #16
0
 public void HandleKeyUp(KeyArgs key)
 {
     UIInputField focused = null;
     if( m_Email.Focused  )
         focused = m_Email;
     else if( m_Password.Focused )
         focused = m_Password;
     if (focused != null)
     {
         if (key.Key == Keys.Enter)
         {
             if( OnSignIn != null )
                 OnSignIn(this, null);
         }
         else if (key.Key == Keys.Tab)
         {
             if (m_Email.Focused)
             {
                 m_Email.Focused = false;
                 m_Password.Focused = true;
             }
         }
         else
         {
             focused.HandleKey(key);
         }
     }
 }
예제 #17
0
 public void HandleKey(KeyArgs key)
 {
     if( m_bEnabled && key.Key == Microsoft.Xna.Framework.Input.Keys.Space )
         m_bChecked = !m_bChecked;
 }
예제 #18
0
 public abstract void ProcessExternalKey(KeyArgs key, InputType type);
예제 #19
0
        char KeyToAscii(KeyArgs key)
        {
            int keyInt = (int)key.Key;

            if (key.Key >= Keys.Num0 && key.Key <= Keys.Num9)
            {
                keyInt -= (int)Keys.Num0;
                if (key.Shift)
                {
                    return(Constants.Ascii0to9Shift[keyInt]);
                }
                else
                {
                    keyInt += '0';
                    return((char)keyInt);
                }
            }
            else if (key.Key >= Keys.A && key.Key <= Keys.Z)
            {
                keyInt -= (int)Keys.A;
                keyInt += key.Shift ? 'A' : 'a';
                return((char)keyInt);
            }
            else if (key.Key == Keys.OemPeriod)
            {
                return((key.Shift) ? '>' : '.');
            }
            else if (key.Key == Keys.OemQuestion)
            {
                return((key.Shift) ? '?' : '/');
            }
            else if (key.Key == Keys.OemComma)
            {
                return((key.Shift) ? '<' : ',');
            }
            else if (key.Key == Keys.OemPipe)
            {
                return(key.Shift ? '|' : '\\');
            }
            else if (key.Key == Keys.OemCloseBrackets)
            {
                return(key.Shift ? '}' : ']');
            }
            else if (key.Key == Keys.OemOpenBrackets)
            {
                return(key.Shift ? '{' : '[');
            }
            else if (key.Key == Keys.OemPlus)
            {
                return(key.Shift ? '+' : '=');
            }
            else if (key.Key == Keys.OemMinus)
            {
                return(key.Shift ? '_' : '-');
            }
            else if (key.Key == Keys.OemTilde)
            {
                return(key.Shift ? '~' : '`');
            }
            else if (key.Key == Keys.Slash)
            {
                return(key.Shift ? '?' : '/');
            }
            else if (key.Key == Keys.Backslash)
            {
                return('\\');
            }
            else if (key.Key == Keys.Equals)
            {
                return(key.Shift ? '+' : '=');
            }
            else if (key.Key == Keys.Apostrophe)
            {
                return(key.Shift ? '\"' : '\'');
            }
            else if (key.Key == Keys.Semicolon)
            {
                return(key.Shift ? ':' : ';');
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("KeyToAscii: " + key.Key.ToString());
            }

            return((char)0);
        }
예제 #20
0
 public void HandleKey(KeyArgs key)
 {
     if( m_Input.Focused )
         m_Input.HandleKey(key);
 }