Esempio n. 1
0
        public bool DetachWithIME()
        {
            if (CanDetachWithIME())
            {
                if (IsVisible)
                {
                    if (IsXAML)
                    {
                        // Let's try to get rid of the soft keyboard.  Really weird workaround finally found to keep
                        // the keyboard hidden without adding a Button control as well and switching focus to it.
                        // Found solution here:
                        // http://stackoverflow.com/questions/10714431/how-to-hide-on-edittext-soft-keyboard-windows-8-metro-application
                        // When the textbox that showed the virtual keyboard has it’s propery IsEnabled set to false, the virtual keyboard
                        // disappears. We can immediately set is to true after that and the virtual keyboard will remain hidden.
                        hiddenKeyInput.IsEnabled = false;
                        hiddenKeyInput.IsEnabled = true;

                        // Let's do the ReadOnly = true just to make sure
                        hiddenKeyInput.IsReadOnly = true;
                    }
                    else
                    {
                        IsVisible = false;
                        OnKeyboardWillHide();
                        TextFieldInFocus.RemoveEventListener(keyboardListener);
                        OnKeyboardDidHide();
                    }
                }
            }
            return(true);
        }
Esempio n. 2
0
        public bool AttachWithIME()
        {
            if (IsXAML)
            {
                return(ShowKeyboardInput());
            }
            else
            {
                if (TextFieldInFocus != null)
                {
                    OnKeyboardWillShow();

                    IsVisible = true;

                    OnKeyboardDidShow();

                    AutoRepeat       = TextFieldInFocus.AutoRepeat;
                    keyboardListener = new CCEventListenerKeyboard();
                    keyboardListener.OnKeyPressed  = OnKeyPressed;
                    keyboardListener.OnKeyReleased = OnKeyReleased;

                    TextFieldInFocus.AddEventListener(keyboardListener);

                    return(true);
                }
            }
            return(false);
        }
 public bool DetachWithIME()
 {
     if (CanDetachWithIME())
     {
         if (IsVisible)
         {
             IsVisible = false;
             OnKeyboardWillHide();
             TextFieldInFocus.RemoveEventListener(keyboardListener);
             OnKeyboardDidHide();
         }
     }
     return(true);
 }
        public bool AttachWithIME()
        {
            ShowKeyboardInput(ContentText);
            if (true)
            {
                if (TextFieldInFocus != null)
                {
                    AutoRepeat       = TextFieldInFocus.AutoRepeat;
                    keyboardListener = new CCEventListenerKeyboard();
                    keyboardListener.OnKeyPressed  = OnKeyPressed;
                    keyboardListener.OnKeyReleased = OnKeyReleased;

                    TextFieldInFocus.AddEventListener(keyboardListener);
                }
            }
            return(true);
        }
Esempio n. 5
0
 protected void StopAutorepeat()
 {
     TextFieldInFocus.Unschedule(Repeater);
 }
Esempio n. 6
0
        protected void StartAutorepeat()
        {
            autorepeatCount--;

            TextFieldInFocus.Schedule(Repeater, AutorepeatDeltaTime, CCSchedulePriority.RepeatForever, AutorepeatDeltaTime * 3);
        }