Question about "User keyboard usage". Beta2 FW
|
11-21-2017, 10:21 PM
Post: #1
|
|||
|
|||
Question about "User keyboard usage". Beta2 FW
I'am using the latest Beta V2 FW but I think it is not specific to this version.
I can't find build in help about the KEY command. In the official pdf doc I read the short text and i'd like to know if we can place more stuff inside the KEY definition and not just a Code: RETURN "a_function_name" And I probably use this function very badly Here are some tests... If you try these code you will see that the KEY_minus don't work at all... on the other hand the KEY K_Ln() executes the inside stuff with success but it return a strange "_" char in the command line when I quit the terminal... Code: 1) Can we do more inside a KEY redefinition than just a Code: RETURN "blabla_function" 2) Where can we find, in the calculator menu, all the redefinitions realized in various programs? Thank you for your help. |
|||
11-22-2017, 04:02 AM
Post: #2
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
The very brief Help screen for KEY can be found both in the Program Editor's "Template / Function" menu, and in the Help Tree (under Program Catalog / Program Editor / Template Menu).
<0|ɸ|0> -Joe- |
|||
11-22-2017, 11:34 AM
Post: #3
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
(11-21-2017 10:21 PM)dg1969 Wrote: 1) Can we do more inside a KEY redefinition than just a RETURN "blabla_function"?Supposedly yes, but adding code before the RETURN can cause problems especially with integrated interfaces. Example: PRINT, MSGBOX, INPUT, etc It is preferable to just return strings, since that is the purpose of a redefinition. You can return reals like: -2+: Default value -1: It does not do anything 0-50: Default according to key ID 51-101: Default according to key ID + Shift 102-152: Default according to key ID + ALPHA 153-203: Default according to key ID + Shift + ALPHA 204+: Default value Example: K_Ln return 100 → ID 49 + Shift → "_" Code: KEY K_Ln() K_Minus return 5050 → Deafult value → "-" Code: KEY K_Minus() (11-21-2017 10:21 PM)dg1969 Wrote: 2) Where can we find, in the calculator menu, all the redefinitions realized in various programs?There is no menu that summarizes the redefinitions Viga C | TD | FB |
|||
11-22-2017, 04:42 PM
(This post was last modified: 11-22-2017 04:44 PM by primer.)
Post: #4
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
(11-22-2017 11:34 AM)Carlos295pz Wrote:Sorry, But I don't agree.(11-21-2017 10:21 PM)dg1969 Wrote: 1) Can we do more inside a KEY redefinition than just a RETURN "blabla_function"?Supposedly yes, but adding code before the RETURN can cause problems especially with integrated interfaces. Maybe it's not a good idea to perform INPUT or MSGBOX (in fact, I'm not sure), but it does not mean you can't do anything else. I wrote a virtual keyboard in that way, I'm doing much more that just "return", and it works perfectly everywhere, in program editor, notes, cas/home screen, any input form, any app... see VBK for example. primer |
|||
11-22-2017, 06:51 PM
Post: #5
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
(11-21-2017 10:21 PM)dg1969 Wrote: 2) Where can we find, in the calculator menu, all the redefinitions realized in various programs?There is no menu that summarizes the redefinitions [/quote] Bonjour Cela doit être réalisable avec Programs et INSTRING. Hello This must be achievable with Programs and INSTRING. Sorry for my english |
|||
11-22-2017, 08:42 PM
(This post was last modified: 11-22-2017 08:45 PM by Tyann.)
Post: #6
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
(11-22-2017 06:51 PM)Tyann Wrote:(11-21-2017 10:21 PM)dg1969 Wrote: 2) Where can we find, in the calculator menu, all the redefinitions realized in various programs?There is no menu that summarizes the redefinitions Bonjour Cela doit être réalisable avec Programs et INSTRING. Hello This must be achievable with Programs and INSTRING. [/quote] Code:
Un premier jet à améliorer. CMID et CINSTR sont issus de ma STRlibrary. Nommer le programme 'CATK' A first throw to improve. CMID and CINSTR are from my STRlibrary. Name the program 'CATK' Sorry for my english |
|||
11-23-2017, 02:47 AM
Post: #7
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
I've got one I use a lot as an example. I dont' like the hex/oct/bin/dec built-in program so I wrote my own and tied it to a user key KA_3.....Alpha 3 or the # char.
It's a menu based program called MBase(), but I activate it from the KEY function. I don't have any code inside the KEY definition itself, but do everything inside the RETURN call as in: RETURN STRING(EVAL(MBASE())); I can't remember why I did it that way, but I think it was because I can allow it to return an expression string that gets evaluated by the EVAL call and then the result gets converted to a STRING, as behavior with keys can be strange when it doesn't return a string. This seems to be a reliable way of doing it. Plus you can put whatever you want inside your function (MBase here). |
|||
11-23-2017, 04:10 PM
Post: #8
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
That is why I was added that returning -1 stops all further processing...
User keys is still very basic as you don't get information regarding where in the system you are, or other information you'd need to be able to adjust things to be more flexible. This and changing it so the processing happens first in the key evaluation tree were the only things I could slip in that wouldn't require major work. TW Although I work for HP, the views and opinions I post here are my own. |
|||
11-23-2017, 08:18 PM
Post: #9
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
Joe Horn, Carlos295pz, primer, Tyann , webmasterpdx and Tim... Thank you very much for your time.
It will take me some time to test all that ... Thanks again ! |
|||
11-23-2017, 10:42 PM
Post: #10
|
|||
|
|||
RE: Question about "User keyboard usage". Beta2 FW
(11-23-2017 04:10 PM)Tim Wessman Wrote: That is why I was added that returning -1 stops all further processing... Oh! with -1 PRINT it no longer overlaps the touch menu Viga C | TD | FB |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)