Custom Widget: how to filter keys ? [message #1778197] |
Mon, 11 December 2017 13:42  |
Eclipse User |
|
|
|
Hello,
I need to finely control what is typed in a field, for instance only some specific digits.
I implemented a custom widget, so far it works, but I can't block unauthorized characters before they are displayed in the field, only afterwards in the _onFieldInput method where I can remove them. This result in the character to be displayed, then immediately removed, from the field.
I would like to avoid this, and just block the character before it is displayed. I tried to understand what 'KeyStrokeContext' does but I don't get it, whatever I try doesn't work, the key event is processed by my KeyStrokeContext object but in the end it is always displayed in the field.
What should I do ?
Thank you.
Michel
|
|
|
|
Re: Custom Widget: how to filter keys ? [message #1778294 is a reply to message #1778236] |
Tue, 12 December 2017 12:13  |
Eclipse User |
|
|
|
Thank you Andre. I understand a little more how this works. I thought that the scout widget (StringWidget) was processing the character keys but it doesn't, the key is just passed in the end to the "default action" which actually does the field update. This really helps.
|
|
|
Powered by
FUDForum. Page generated in 0.04855 seconds