873 views
in GUI Development by
Hi Everyone,

       I am new in Embedded wizard tool.

      Now i am creating small registeration form with basic details (name,mobile,gender...).Here i am using Virtual key board to enter the data.

  How to restrict the special characters like @,#<! ...   .we can allow only Albhabets .so how to implement in Texteditor.

can you plase help me to resolve this.

2 Answers

0 votes
by

Hello,

I assume that your text edit field has a Key Handler to react on the key events that are provided by the virtual keyboard or by a real keyboard.

Now you can set an appropriate Filter of the Key Handler (e.g. Core::KeyCode.AlphaKeys or Core::KeyCode.AlphaOrDigitKeys) so that only 'A'...'Z' is handled.

Alternatively, you can set Filter to Core::KeyCode.CharacterKeys so that all characters are provided and then you can process the provided key code by yourself - this can be done by evaluating the variable CharCode of the Key Handler.

I hope this helps.

Best regards,

Manfred.

0 votes
by

Hello GuroRamesh,

as Manfred mentioned, you can configure the corresponding handler to react to given character codes only. In case of the Text Editor template the corresponding handler is the CharacterKeyHandler as shown in the screenshot below:

For special filter cases, however, you will need to formulate the desired filter condition programmatically. In such case, the character codes in the Text Editor template are processed in the method onCharacterKey. You can modify the method to only react to particular key. For example, if you want to react to upper case letters A .. Z, you can add following rows (highlighted in the screenshot) to the method. See also the section Reject the just received key press event):

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...