Post Reply 
Virtual Calculator Keys
12-14-2017, 05:39 AM
Post: #1
Virtual Calculator Keys
I like how on the Virtual Prime Calculator running on my PC I can start typing on my keyboard and not having to worry about Alpha, Shift+Alpha, etc, the keys are recognized properly and it's thus faster to type commands and so forth.

Working on a custom key-handler I was hoping it might be possible to do the same, however that doesn't appear to be possible. The numeric keys on the PC keyboard, when pressed, return the expected result with WAIT(-1), but the A-Z keys (possibly others) do not register anything with WAIT(-1).

Is someone with more knowledge on the subject able to comment on this? I would be fine with the KA_* and KSA_* equivalent codes, if they were generated in the Virtual calculator through the PC keyboard, if that were possible.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-14-2017, 07:57 AM
Post: #2
RE: Virtual Calculator Keys
But that would makes your program not compatible with physical calculator, as it would not be possible to raise they keys.

primer
Find all posts by this user
Quote this message in a reply
12-14-2017, 04:52 PM
Post: #3
RE: Virtual Calculator Keys
(12-14-2017 07:57 AM)primer Wrote:  But that would makes your program not compatible with physical calculator, as it would not be possible to raise they keys.

Should be possible to do both, maybe a modified WAIT is required that returns not just 0-50, but the key code representative of Alpha and Shift states. In my program I keep track of those states myself and handle accordingly.

The virtual machine could just return the corresponding code of the equivalent result from the hardware.
Visit this user's website Find all posts by this user
Quote this message in a reply
12-20-2017, 01:24 AM
Post: #4
RE: Virtual Calculator Keys
The reason they don't return anything is that they aren't actually actuating keys! Note how certain keys such as ENTER, 1, 2, 3, ESC and so on show the keyboard image being "pressed". These are defined in your skin file. However, alpha text is being passed direct into the code as a text event. Imagine if each time you typed a on the keyboard, you saw the calculator do a SHIFT ALPHA A at once. It wouldn't improve understandability of what was happening, but just be really distracting and hard to understand.

This is also why users of international keyboards with non-US layouts and symbols can still directly use the keyboard and the expected character comes out. Some keyboards have a superscript 2 that actuates the X^2 button for example. Only if it has a direct mapping to a single keystroke did I make the button "press" visually.

I suppose an extension could be made to the "ISKEYDOWN", or maybe a new one called ISTEXT( ) could be made that lets you do something like ISKEYDOWN("a","A","Á") and that would allow you to take specific actions on those specific incoming matching text items as well...


I will need to think about this and if it makes sense. Thanks for the suggestion and if enough people seem to like it I may stick it in for potential future releases.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
12-20-2017, 03:34 AM
Post: #5
RE: Virtual Calculator Keys
(12-20-2017 01:24 AM)Tim Wessman Wrote:  The reason they don't return anything is that they aren't actually actuating keys!

I thought that might be the case, but hadn't considered all the international keyboards...

(12-20-2017 01:24 AM)Tim Wessman Wrote:  I will need to think about this and if it makes sense. Thanks for the suggestion and if enough people seem to like it I may stick it in for potential future releases.

Probably a low impact feature if it were implemented, I'll give it some further thought but certainly only a "would be nice" thing really.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: