Example #1
0
        private void Keyboard_initialized(object sender, System.EventArgs e)
        {
            KeyboardButtons abc1 = new KeyboardButtons("abc1");
            this.buttonGrid.Children.Add(abc1);

            KeyboardButtons def2 = new KeyboardButtons("def2");
            this.buttonGrid.Children.Add(def2);

            KeyboardButtons ghi3 = new KeyboardButtons("ghi3");
            this.buttonGrid.Children.Add(ghi3);

            KeyboardButtons jkl4 = new KeyboardButtons("jkl4");
            this.buttonGrid.Children.Add(jkl4);

            KeyboardButtons mno5 = new KeyboardButtons("mno5");
            this.buttonGrid.Children.Add(mno5);

            KeyboardButtons pqr6 = new KeyboardButtons("pqr6");
            this.buttonGrid.Children.Add(pqr6);

            KeyboardButtons stu7 = new KeyboardButtons("stu7");
            this.buttonGrid.Children.Add(stu7);

            KeyboardButtons vwx8 = new KeyboardButtons("vwx8");
            this.buttonGrid.Children.Add(vwx8);

            KeyboardButtons yzat9 = new KeyboardButtons("yz@9");
            this.buttonGrid.Children.Add(yzat9);

            KeyboardButtons symb = new KeyboardButtons(".*/0");
            this.buttonGrid.Children.Add(symb);
        }
Example #2
0
        public override void Update(GameTime gameTime = null)
        {
            KeyboardButtons keyboardButtons = new KeyboardButtons();

            currentState = Keyboard.GetState();

            foreach (Keys key in Enum.GetValues(typeof(Keys)))
            {
                keyboardButtons.addKeyPress(key, checkKey(key));
            }

            previousState = currentState;

            buttonStates = keyboardButtons;
        }
        public Boolean IsButtonPressed(KeyboardButtons keyboardButton)
        {
            switch (keyboardButton)
            {
            case KeyboardButtons.Control:
                return(IsButtonPressed(KeyboardButtons.LControlKey) ||
                       IsButtonPressed(KeyboardButtons.RControlKey));

            case KeyboardButtons.Shift:
                return(IsButtonPressed(KeyboardButtons.LShiftKey) ||
                       IsButtonPressed(KeyboardButtons.RShiftKey));

            default:
                var retVal = Native.GetKeyState((Int32)keyboardButton);
                return((retVal & 0x8000) == 0x8000);
            }
        }
Example #4
0
        //Loop through each KeyboardRow linear layout and for each button in the row assign a click event handler and add the button to a List of keyboard buttons.
        private void KeyboardSetup()
        {
            LinearLayout Keyboard = FindViewById <LinearLayout>(Resource.Id.linearLayoutKeyboard);

            for (int i = 0; i < Keyboard.ChildCount; i++)
            {
                var r = Keyboard.GetChildAt(i);
                if (r is LinearLayout)
                {
                    LinearLayout Row = (LinearLayout)r;
                    for (int j = 0; j < Row.ChildCount; j++)
                    {
                        var l = Row.GetChildAt(j);
                        if (l is Button)
                        {
                            l.Click += Letter_Click;
                            KeyboardButtons.Add((Button)l);
                        }
                    }
                }
            }
        }
Example #5
0
        public override void setAllowedButtons(KeyboardButtons[] allowedButtons)
        {
            foreach (Button button in this.keyboardMatrix)
            {
                if(button != null)
                button.Enabled = false;
            }

            foreach (KeyboardButtons kb in allowedButtons)
            {
                switch (kb)
                {
                    case KeyboardButtons.AlphaA:
                        this.BtAlphaA.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaB:
                        this.BtAlphaB.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaC:
                        this.BtAlphaC.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaD:
                        this.BtAlphaD.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaE:
                        this.BtAlphaE.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaF:
                        this.BtAlphaF.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaG:
                        this.BtAlphaG.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaH:
                        this.BtAlphaH.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaI:
                        this.BtAlphaI.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaJ:
                        this.BtAlphaJ.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaK:
                        this.BtAlphaK.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaL:
                        this.BtAlphaL.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaM:
                        this.BtAlphaM.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaN:
                        this.BtAlphaN.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaO:
                        this.BtAlphaO.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaP:
                        this.BtAlphaP.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaQ:
                        this.BtAlphaQ.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaR:
                        this.BtAlphaR.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaS:
                        this.BtAlphaS.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaT:
                        this.BtAlphaT.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaU:
                        this.BtAlphaU.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaV:
                        this.BtAlphaV.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaW:
                        this.BtAlphaW.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaX:
                        this.BtAlphaX.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaY:
                        this.BtAlphaY.Enabled = true;
                        break;
                    case KeyboardButtons.AlphaZ:
                        this.BtAlphaZ.Enabled = true;
                        break;
                    case KeyboardButtons.NumericOne:
                        this.BtNum1.Enabled = true;
                        break;
                    case KeyboardButtons.NumericTwo:
                        this.BtNum2.Enabled = true;
                        break;
                    case KeyboardButtons.NumericThree:
                        this.BtNum3.Enabled = true;
                        break;
                    case KeyboardButtons.NumericFour:
                        this.BtNum4.Enabled = true;
                        break;
                    case KeyboardButtons.NumericFive:
                        this.BtNum5.Enabled = true;
                        break;
                    case KeyboardButtons.NumericSix:
                        this.BtNum6.Enabled = true;
                        break;
                    case KeyboardButtons.NumericSeven:
                        this.BtNum7.Enabled = true;
                        break;
                    case KeyboardButtons.NumericEight:
                        this.BtNum8.Enabled = true;
                        break;
                    case KeyboardButtons.NumericNine:
                        this.BtNum9.Enabled = true;
                        break;
                    case KeyboardButtons.NumericZero:
                        this.BtNum0.Enabled = true;
                        break;
                    case KeyboardButtons.SpecialCharAt:
                        this.BtSpecAt.Enabled = true;
                        break;
                    case KeyboardButtons.SpecialCharSpace:
                        this.BtSpecSpace.Enabled = true;
                        break;
                    case KeyboardButtons.SpecialCharReturn:
                        this.BtSpecReturn.Enabled = true;
                        break;
                    case KeyboardButtons.SpecialCharBackspace:
                        this.BtSpecBackspace.Enabled = true;
                        break;
                    case KeyboardButtons.PunctationDot:
                        this.BtPunctDot.Enabled = true;
                        break;
                    case KeyboardButtons.PunctationComma:
                        this.BtPunctComma.Enabled = true;
                        break;
                    case KeyboardButtons.PunctationQuestion:
                        this.BtPunctQuestion.Enabled = true;
                        break;
                    case KeyboardButtons.PunctationExclamation:
                        this.BtPunctExclamation.Enabled = true;
                        break;
                    case KeyboardButtons.UmlautA:
                        this.BtUmlA.Enabled = true;
                        break;
                    case KeyboardButtons.UmlautO:
                        this.BtUmlO.Enabled = true;
                        break;
                    case KeyboardButtons.UmlautU:
                        this.BtUmlU.Enabled = true;
                        break;
                    case KeyboardButtons.UmlautS:
                        this.BtUmlS.Enabled = true;
                        break;
                    case KeyboardButtons.MenuMessageNew:
                        this.BtMenuMessageNew.Enabled = true;
                        break;
                    case KeyboardButtons.MenuMessageSent:
                        this.BtMenuMessageSent.Enabled = true;
                        break;
                    case KeyboardButtons.MenuMessageRecv:
                        this.BtMenuMessageRecv.Enabled = true;
                        break;
                    case KeyboardButtons.MenuContactNew:
                        this.BtMenuContactAdd.Enabled = true;
                        break;
                    case KeyboardButtons.MenuContactEdit:
                        this.BtMenuContactEdit.Enabled = true;
                        break;
                    case KeyboardButtons.MenuContactDelete:
                        this.BtMenuContactDelete.Enabled = true;
                        break;
                    case KeyboardButtons.TextSizeUp:
                        this.BtMenuFontBigger.Enabled = true;
                        break;
                    case KeyboardButtons.TextSizeDown:
                        this.BtMenuFontSmaller.Enabled = true;
                        break;
                    case KeyboardButtons.TextToSpeech:
                        this.BtMenuTextToSpeech.Enabled = true;
                        break;
                    case KeyboardButtons.TextSend:
                        this.BtMenuSend.Enabled = true;
                        break;
                    case KeyboardButtons.ApplicationClose:
                        this.BtMenuClose.Enabled = true;
                        break;
                    case KeyboardButtons.NotInUse:
                        break;
                    default:
                        break;
                }
            }
            this.setDefaultFocus();
        }
 public Boolean AreButtonsPressed(KeyboardButtons button1, KeyboardButtons button2,
                                  KeyboardButtons button3)
 {
     return(AreButtonsPressed(
                button1, button2) && IsButtonPressed(button3));
 }
 public Boolean AreButtonsPressed(KeyboardButtons button1,
                                  KeyboardButtons button2)
 {
     return(IsButtonPressed(button1) && IsButtonPressed(button2));
 }
Example #8
0
 public Boolean IsButtonPressed(KeyboardButtons keyboardButton)
 {
     throw new NotImplementedException();
 }
Example #9
0
 public Boolean AreButtonsPressed(KeyboardButtons button1,
                                  KeyboardButtons button2,
                                  KeyboardButtons button3)
 {
     throw new NotImplementedException();
 }
 Boolean IInputProvider.IsButtonPressed(KeyboardButtons keyboardButton)
 {
     return(false);
 }
 Boolean IInputProvider.AreButtonsPressed(KeyboardButtons button1,
                                          KeyboardButtons button2,
                                          KeyboardButtons button3)
 {
     return(false);
 }