The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP PRIME : strange behavior when trying user key capability
Message #1 Posted by Damien on 31 Oct 2013, 5:08 p.m.

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
Message #2 Posted by Patrice on 31 Oct 2013, 6:04 p.m.,
in response to message #1 by Damien

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
Message #3 Posted by Damien on 31 Oct 2013, 6:25 p.m.,
in response to message #2 by Patrice

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
Message #4 Posted by Tim Wessman on 31 Oct 2013, 7:52 p.m.,
in response to message #1 by Damien

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
Message #5 Posted by Patrice on 31 Oct 2013, 8:25 p.m.,
in response to message #4 by Tim Wessman

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

                  
Re: HP PRIME : strange behavior when trying user key capability
Message #6 Posted by Tim Wessman on 31 Oct 2013, 9:06 p.m.,
in response to message #5 by Patrice

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
Message #7 Posted by Damien on 1 Nov 2013, 3:11 a.m.,
in response to message #4 by Tim Wessman

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
Message #8 Posted by René Franquinet on 1 Nov 2013, 8:49 a.m.,
in response to message #7 by Damien

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
Message #9 Posted by Tim Wessman on 1 Nov 2013, 10:38 a.m.,
in response to message #7 by Damien

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
Message #10 Posted by Damien on 1 Nov 2013, 11:16 a.m.,
in response to message #9 by Tim Wessman

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
Message #11 Posted by fabrice48 on 2 Nov 2013, 2:48 p.m.,
in response to message #10 by Damien

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

                                    
Re: HP PRIME : strange behavior when trying user key capability
Message #12 Posted by Damien on 2 Nov 2013, 3:36 p.m.,
in response to message #11 by fabrice48

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
Message #13 Posted by Joe Horn on 3 Nov 2013, 11:02 a.m.,
in response to message #11 by fabrice48

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. ;-)


[ Return to Index | Top of Index ]

Go back to the main exhibit hall