private void TextViewItemClick(object sender, EventArgs e)
        {
            if (mSelectedTextView != null)
            {
                mSelectedTextView.Activated = false;
            }

            mSelectedTextView           = (TextView)sender;
            mSelectedTextView.Activated = true;

            int id = mSelectedTextView.Id;

            if (id == Resource.Id.keyboard_number_0)
            {
                if (mShowingKeyboard != Resource.Xml.keyboard_vehicle_province_1)
                {
                    mShowingKeyboard       = Resource.Xml.keyboard_vehicle_province_1;
                    mKeyboardView.Keyboard = mProvinceKeyboard_1;
                }
            }
            else if (id == Resource.Id.keyboard_number_1)
            {
                string number = GetInput(mNumbersTextView);
                if (number.StartsWith(WJ_PREFIX))
                {
                    mShowingKeyboard       = Resource.Xml.keyboard_vehicle_province_0;
                    mKeyboardView.Keyboard = mProvinceKeyboard_0;
                }
                else
                {
                    if (mShowingKeyboard != Resource.Xml.keyboard_vehicle_code)
                    {
                        mShowingKeyboard       = Resource.Xml.keyboard_vehicle_code;
                        mKeyboardView.Keyboard = mCityCodeKeyboard;
                    }
                }
            }
            else if (id == Resource.Id.keyboard_number_6)
            {
                if (mShowingKeyboard != Resource.Xml.keyboard_vehicle_number_extra)
                {
                    mShowingKeyboard       = Resource.Xml.keyboard_vehicle_number_extra;
                    mKeyboardView.Keyboard = mNUmberExtraKeyboard;
                }
            }
            else
            {
                if (mShowingKeyboard != Resource.Xml.keyboard_vehicle_number)
                {
                    mShowingKeyboard       = Resource.Xml.keyboard_vehicle_number;
                    mKeyboardView.Keyboard = mNumberKeyboard;
                }
            }

            mKeyboardView.InvalidateAllKeys();
            mKeyboardView.Invalidate();
        }
Exemple #2
0
        public void OnKey([GeneratedEnum] Android.Views.Keycode primaryCode, [GeneratedEnum] Android.Views.Keycode [] keyCodes)
        {
            IInputConnection ic = CurrentInputConnection;

            switch ((int)primaryCode)
            {
            case (int)Android.Views.Keycode.Del:
                //ic.SendKeyEvent(new KeyEvent(KeyEventActions.Down,Android.Views.Keycode.Del));
                ic.DeleteSurroundingText(1, 0);
                break;

            case -1:
                caps = !caps;
                keyboard.SetShifted(caps);
                kv.InvalidateAllKeys();
                break;

            case (int)Android.Views.Keycode.Enter:
                ic.SendKeyEvent(new KeyEvent(KeyEventActions.Down, Android.Views.Keycode.Enter));
                break;

            case (int)Android.Views.Keycode.Button9:
                try {
                    onREC();
                }
                catch (System.Exception ex) {
                    Toast.MakeText(this, "PSVITA Connected", ToastLength.Long).Show();
                    Log.Info("Exception: ", ex.ToString());
                }

                break;

            default:
                char code = (char)primaryCode;
                if (Character.IsLetter(code) && caps)
                {
                    code = Character.ToUpperCase(code);
                }
                ic.CommitText(Java.Lang.String.ValueOf(code), 1);
                break;
            }
        }