29 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

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...