void M_Input_OnKeyUp(object sender, KeyArgs e) { if (e.Key == Microsoft.Xna.Framework.Input.Keys.Escape) { Pause(); } }
public void HandleKey(KeyArgs key) { if (m_bEnabled && key.Key == Keys.Space) { m_bChecked = !m_bChecked; } }
public void HandleKey(KeyArgs key) { if (m_bEnabled && key.Key == Microsoft.Xna.Framework.Input.Keys.Space) { m_bChecked = !m_bChecked; } }
private void IC_OnKeyUp(object sender, KeyArgs e) { if (m_SignInDialog != null) { m_SignInDialog.HandleKeyUp(e); } }
public void HandleKey(KeyArgs key) { if (m_Input.Focused) { m_Input.HandleKey(key); } }
public bool OnKeyUp(KeyArgs e) { if (e.Key == Keys.Escape) { return(false); } return(true); }
public bool OnKeyDown(KeyArgs key) { if (key.Key == Keys.Escape) { SoundManager.Inst.PlaySound(SoundManager.SEInst.MenuCancel); return(false); } return(true); }
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); } } }
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 += "*"; } } }
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(); } } }
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(); } } }
protected void Invoke_OnKeyRepeat(object sender, KeyArgs args) { OnKeyRepeat?.Invoke(sender, args); }
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); } } }
protected void Invoke_OnKeyUp(object sender, KeyArgs args) { OnKeyUp?.Invoke(sender, args); }
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); }
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); } } }
public void HandleKey(KeyArgs key) { if( m_bEnabled && key.Key == Microsoft.Xna.Framework.Input.Keys.Space ) m_bChecked = !m_bChecked; }
public abstract void ProcessExternalKey(KeyArgs key, InputType type);
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); }
public void HandleKey(KeyArgs key) { if( m_Input.Focused ) m_Input.HandleKey(key); }