Explanation of public Keyboard(int width, int height, int numViews, int keyHeight, int keySpacing); with Glide 1.0.0

Hi Forum,
I’m using Glide and a the downloaded version of the http://www.ghielectronics.com/glide/example/6/ which has 4 gif background images

Upper case alpha
Lowercase alpha
numeric
symbols

I would like to know where I can find more information on the Keyboard() constructor and what values NumViews argument can be set to. The example hard codes to 3! But what else can be used, an example would be really appreciated.

where Views = {Letters, Numbers, Symbols} = 3
My aim is to restrict a field to either:

  • Numeric only
  • alpha + numeric
  • alpha + numeric + symbols
  • alpha only
  • alpha UPPERCASE only
  • alpha LOWERCASE only

But I am struggling on how to achieve this. Any assistance would be appreciated.

I need to understand the relationship between the 4:3 ratio between KeyContents:views

I can see how to load up the KeyWidth[] for each view but struggle to work out how I would load up the
KeyContents[] Array for Upper and lowercase!

Reason: Loading all 8 resource gif files (4 x Up + 4 x Down) takes a few seconds, so I’m trying to reduce this time by only loading resources required.

It’s not possible to restrict to upper or lower at the moment. However to restrict keys/views do the following:

        static void InitWin()
        {
            // Get the TextBox
            TextBox textBox = (TextBox)window.GetChildByName("textBox");
            textBox.TapEvent += new OnTap(textBox_TapEvent);
        }

        static void textBox_TapEvent(object sender)
        {
            // Restrict view to letters
            Glide.Keyboard.SetView(Keyboard.View.Letters);
            Glide.Keyboard.Restricted = new string[1] { Keyboard.ActionKey.ToNumbers };
            Glide.Keyboard.CalculateKeys();

            Glide.OpenKeyboard(sender);
        }

Thanks Josh,
I was testing the Restricted array, as my only option just now.

I Guess I can to a ToUpper() or toLower() on a Value Change Event


TextBox.ValueChangedEvent += new OnValueChanged(textBox_ValueChangedEvent);

private void textBox_ValueChangedEvent(object sender)
{
            TextBox textBox = (TextBox)mWindow.GetChildByName("answer");
            msResult = textBox.Text.ToUpper();
            //msResult = textBox.Text.ToLower();
}

I know this is an old thread, but it feels like the best place for my question.

I’m trying to figure out how to make the “lowercase state” of the Keyboard.View.Letters view be the default one once we open up the keyboard. Apparently, the keyboard always opens in an “uppercase” state. I’ve already tried setting the Keyboard.Uppercase property to false before opening the keyboard, and that does force the initial state of the tapped in letters to lowercase, but it does not change the keyboard’s background image.In this case only after tapping the ToggleCase key a second time, the background changes accordingly, but then, the lowercase/uppercase states get messed up.

Any ideas?

no problem… I’ll open up a new one