08-13-2020 05:26 AM - edited 08-13-2020 05:31 AM
Hi tan,
@tan99323 wrote:
Keydown event : Can I know why I only can input single number from numpad?
Because you have it programmed this way!
What's wrong here?
Why do you need to convert the "Char" to U32?
Why do you check for "equal to ´0´"? Isn't it allowed to input a zero somewhere in the numeric input?
When the char is <> "0" then you use the char - but you don't use the previously typed chars (as should be available by the "User input" shift register)!
When the char is =="0" then you even get rid of older "User input" and still use the "Operation" input instead. Didn't I mention this problem before???
@tan99323 wrote:
how to have more input ? like 13
Don't forget to use the previous user input…
08-13-2020 10:30 PM
And how to let the backspace button work ? because when i press backspace it appear as a square symbol instead of delete the entry.
08-14-2020 12:29 AM
Hi tan,
@tan99323 wrote:
And how to let the backspace button work ?
How should the backspace key behave?
When you answer that question then you also should know how to handle that key!
@tan99323 wrote:
because when i press backspace it appear as a square symbol instead of delete the entry.
Any other key will also produce an unwanted result with your current implementation!
What about filtering the user input to only use allowed keys?
Again: the VI works as programmed (by you)!
When you want some other/different behaviour then you need to define the required behaviour and to change the code of your VI accordingly: this process is called "programming"…
08-14-2020 04:05 AM - edited 08-14-2020 04:05 AM
How to set for true case for delete key press so only last data entry ill be deleted ? For example, previous data is 1234 and I want to delete the number 4 after press delete.
08-14-2020 04:07 AM - edited 08-14-2020 04:09 AM
Hi tan,
@tan99323 wrote:
How to set for true case for delete key press so only last data entry ill be deleted ? For example, previous data is 1234 and I want to delete the number 4 after press delete.
So you want to delete the last char in a string of several chars?
Which function of the string palette might be used for this?
What about StringLength and StringSubset? Or what about ReverseString, StringSubset, ReverseString?
What have you tried and where are you stuck?
Most part of "programming" involves thinking about (or developing) algorithms - before starting to code…
08-14-2020 04:31 AM
I have figured out with reverse string . How about let the vi perform add function as i press + in keyboard. Should I add new event case of just perform it in the same keypress event ? Or any possibility that I just bind the + in keypress direct to the Add boolean button ?
08-14-2020 04:44 AM - edited 08-14-2020 04:44 AM
Hi tan,
@tan99323 wrote:
How about let the vi perform add function as i press + in keyboard. Should I add new event case of just perform it in the same keypress event ?
This depends on your design decision. You made a decision, did you?
As said before: "programming" contains a lot of "planning what to do" - before starting to code…
@tan99323 wrote:
Or any possibility that I just bind the + in keypress direct to the Add boolean button ?
Did you try to set a "key navigation" for that "Add" button? Which keys are allowed here?
Does that fit your requirements?
After all those messages you should maybe start from scratch.
Learn about state machines and/or producer/consumer schemes (like QMH). Right now you have a producer (your event structure handling all user input) and you need a consumer, which does some actions based on that user input.
As said before: plan/develop your algorithm before starting to code!
08-15-2020 03:44 AM
I mean to link the + - * / from the keyboard to their respective arithmetic boolean button. So is there any way to link those keyboard entry directly to the boolean button ? Means it choose Add operator as I press + from keyboard. I have declare all those arithmetic function in other event.
08-15-2020 03:52 AM
Hi tan,
@tan99323 wrote:
I mean to link the + - * / from the keyboard to their respective arithmetic boolean button. So is there any way to link those keyboard entry directly to the boolean button ? Means it choose Add operator as I press + from keyboard. I have declare all those arithmetic function in other event.
Have you tried what I wrote in my last message? Then you should know by now!
Handling the +-*/ keys is the same as with 0123456789 keys: you already have that Keypress event case, so all you need to do is to implement some more key handling…
08-15-2020 04:03 AM
I have tried the key navigation but the +-/* from keyboard is not listed at there.