HP Forums
HP PRIME : strange behavior when trying user key capability - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: HP PRIME : strange behavior when trying user key capability (/thread-254477.html)



HP PRIME : strange behavior when trying user key capability - Damien - 10-31-2013

Hi everyone !

Today i wanted to try the Prime user keyboard capability, on
my young lady received a few days ago:
(And i love her ! But not the ugly small font!)

KEY K_Vars
BEGIN
IF CHOOSE(N,"Radian","Degree") THEN
// MANUAL edition July 2013
// ! p575 HAngle var values are inverted !
IF N == 1 THEN HAngle:=0; END; // 0 for RADIAN
IF N == 2 THEN HAngle:=1; END; // 1 for DEGREE
END;
END;

SO, I am in Home function, with degrees for angle unit.

I press shift+help, 1U appears on top left corner, i press the
Vars key then the choose box appears, i choose option 1 to select
radian, and angle setting switch from degree to radian, it works !

BUT AT THE SAME TIME THE APPLICATION LIBRARY OPENS.

WHY ? something wrong with my HPPL coding ?


Thanks !

Edited: 31 Oct 2013, 5:45 p.m.


Re: HP PRIME : strange behavior when trying user key capability - Patrice - 10-31-2013

He si tu essayais une simple bascule sans saisie ?

IF HAngle == 0 THEN HAngle:=1; ELSE HAngle:=0; END;


Re: HP PRIME : strange behavior when trying user key capability - Damien - 10-31-2013

En simplifiant:

KEY K_Vars
BEGIN
IF HAngle == 0 // RAD
THEN
HAngle:=1 // DEG
ELSE
HAngle:=0 // RAD
END;
END;

En lançant ce code via le clavier utilisateur Shift+Help puis Vars:

1) Si je suis en degré j'atterris sur le menu Application
Library (APPS) en ayant basculé en radian.

2) Inversement, si je suis en radian j'atterris sur le menu function
symbolic view (Symb) en ayant basculé en degré bien sûr.

Edited: 6 Nov 2013, 4:46 a.m.


Re: HP PRIME : strange behavior when trying user key capability - Tim Wessman - 10-31-2013

Currently, returning a string will generate a text event. A number is interpreted as a keypress.

Add a -1 at the end and it will not press the APPS key. Every function will always return the last object in the runstream by default as the system is designed such that all functions must return an item.

BEGIN
IF CHOOSE(N,"Radian","Degree") THEN
// MANUAL edition July 2013
// ! p575 HAngle var values are inverted !
IF N == 1 THEN HAngle:=0; END; // 0 for RADIAN
IF N == 2 THEN HAngle:=1; END; // 1 for DEGREE
END;
-1; //returns -1, without this whatever value HAngle is set to will be returned.
END;

TW

Edited: 31 Oct 2013, 7:52 p.m.


Re: HP PRIME : strange behavior when trying user key capability - Patrice - 10-31-2013

I don't remember UG telling about -1 to avoid keystroke.


Re: HP PRIME : strange behavior when trying user key capability - Tim Wessman - 10-31-2013

Don't know if it does. I am just assuming anything that doesn't line up in the key number range won't do anything.

TW


Re: HP PRIME : strange behavior when trying user key capability - Damien - 11-01-2013

Hi everyone,

adding RETURN -1; did not change anything...

Changing user key to Apps key:

KEY   K_Apps()// instead of K_Vars()
BEGIN
IF HAngle == 0 // RAD
THEN
HAngle:=1 // DEG
ELSE
HAngle:=0 // RAD
END;
RETURN -1;
END;

Now, the screen switch to APPLICATION LIBRARY corresponding to the key pressed...
A problem with keyboard buffer ?

Thanks




Re: HP PRIME : strange behavior when trying user key capability - René Franquinet - 11-01-2013

I think I will buy the Prime at the moment all childhood diseases have gone, but I am afraid some will remain. ;o)


Re: HP PRIME : strange behavior when trying user key capability - Tim Wessman - 11-01-2013

My mistake! Returning anything outside the key range or a string will just pass through as if you did nothing and process like normal. That range is 0-203 (4 key planes, 51 keys). I'd recommend returning something like 46+51*2 or 148 which will, correspond to the alpha plane of the ON button (which will be a NOP basically).

Right now, user keys were really just implemented to support rearranging the keyboard, or returning some text.

TW




Re: HP PRIME : strange behavior when trying user key capability - Damien - 11-01-2013

Bad news for me..

Quote:
Right now, user keys were really just implemented to support rearranging the keyboard, or returning some text.

To my mind, it greatly limits the use of user keys.

Thank you for your help.

Cheers.

Damien


Edited: 1 Nov 2013, 12:00 p.m.


Re: HP PRIME : strange behavior when trying user key capability - fabrice48 - 11-02-2013

where did you find informations about Hangle ?????


Re: HP PRIME : strange behavior when trying user key capability - Damien - 11-02-2013

Hi,

In the user manual, (a pdf file edition July 2013) on page 575 if i remember well.

Dam.




Re: HP PRIME : strange behavior when trying user key capability - Joe Horn - 11-03-2013

Quote:
where did you find informations about Hangle ?????

It's also explained in its help screen. Press Home Vars 6 Help.

It's helpful to look at the help screen for all the "Settings" vars. Except for Bits and Signed, they seem to be correct. ;-)