HP PRIME : strange behavior when trying user key capability
#1

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.

#2

He si tu essayais une simple bascule sans saisie ?

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

#3

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.

#4

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.

#5

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

#6

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

#7

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

#8

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

#9

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

#10

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.

#11

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

#12

Hi,

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

Dam.

#13

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



Possibly Related Threads…
Thread Author Replies Views Last Post
  Does the HP Prime really compiles the user programs? CompSystems 3 2,702 12-13-2013, 01:55 PM
Last Post: Mike Morrow
  Strange HP 25 Problem (Repair) Onur Ilkorur 5 2,794 12-06-2013, 05:13 PM
Last Post: Onur Ilkorur
  Strange Battery Icon during updaate of Prime Firmware. Harold A Climer 7 3,417 12-05-2013, 04:40 PM
Last Post: Michael de Estrada
  HP 50g switching two keys in the user keyboard Sean Freeman 9 3,865 12-05-2013, 11:44 AM
Last Post: Mark Puscas
  More Prime problems - lost Apps key again Michael de Estrada 10 2,902 11-16-2013, 12:46 PM
Last Post: Michael de Estrada
  HP Prime - User manual lack bluesun08 6 2,528 11-08-2013, 05:38 PM
Last Post: bluesun08
  HP Prime - EEX/X/Toolbox-key suggestions bluesun08 2 1,488 11-07-2013, 06:15 PM
Last Post: bluesun08
  HP PRIME: How to use [a b/c] key from a program Joseph Ec 4 1,853 10-29-2013, 06:18 PM
Last Post: Joseph Ec
  Roll-down key in HP-15C Steve Ross 6 2,221 10-15-2013, 04:12 AM
Last Post: Nick_S
  Temporary User Mode Key Programs not working in RPN BruceTTT 7 2,622 10-14-2013, 01:46 PM
Last Post: BruceTTT

Forum Jump: