12-28-2013 05:19 PM
Hi there,
I follow one example online to deveope a xcontrol for string input but limiting the input characters only to uppercase A to Z. I have the main code shown as follow
In the Key down event, I discard all input character with ascii code beyond [65, 90]. This seems to works but if I keep pressing down a forbidden key (e.g. %), it will show that key in the control. So how can I ban the input by long press on one key? Thanks.
Solved! Go to Solution.
12-30-2013 09:06 AM
Maybe you should try including a "key repeat?" event. This will handle the cases when a character is added when the user holds down the key. I believe that you will just need to copy all the code from the "key down?" event.
Jeremy P.
12-30-2013 09:09 AM
Or perhaps I should have suggested that you just add the "Key Repeat?" event to be handled by that case. You can have more than more event handled per case.
Jeremy P.
12-30-2013 01:47 PM
@Prickly_Pear wrote:
Or perhaps I should have suggested that you just add the "Key Repeat?" event to be handled by that case. You can have more than more event handled per case.
Jeremy P.
Thanks. I didn't see there is Key Repeat before. I think that's what I am looking for. I will try that later.
12-30-2013 02:04 PM - edited 12-30-2013 02:05 PM
Hi dragondriver,
and while you're editing your VI you should use an InRangeAndCoerce function to replace two comparisons and a boolean function!
You might even think about using "LexicalClass", but that requires additional comparisons too...
#8000