HP 50g switching two keys in the user keyboard


I've read through this article from HP on assigning custom functions and variables to the user keyboard, but I'm not sure how (if possible) to apply it to what I want to do.

I would like to swap the MODE key with the Left Shifted MODE key. Or to put another way, I want to press MODE and have it enter the CUSTOM command, and use Left Shift MODE to get to the modes menu. This is on a 50g.

I may just be understanding the format incorrectly, I don't know. Does anyone have any ideas on how to go about this?

From what I understand, the mode key is key number 22 and unshifted would be 22.0 or 22.1 while left shifted would be 22.2, I'm just not sure how to incorporate that into swapping the key actions.


Check out the commands STOKEYS and RCLKEYS, find these at:

This gives a list of key assignments. The list can include programs, i.e. <<>>.

Write a program such as <<1.01 MENU>> followed by a keycode such as 22.0 and include it in the list, and execute STOKEYS.

A complete list of menus is in the Advanced User Reference, but:

0 Last Menu
1 Custom Menu
3 Math
4 Math Vector
and so on...

Key codes: .0 or .1 unshifted, .2 left shift, .3 right shift, and so on. Don't forget a "1" can be added e.g. .21 for push and hold operations, and for the MENU functions a decimal can be added for page number.

Hope this helps!


Thanks for the reply. I found in the advanced reference manual that modes is menu number 63, but this doesn't display the same screen as pressing the MODE key. That brings up the Calculator Modes screen and that is what I would like to swap places with the custom menu action.

Is there a way to access the screen that pressing the MODE key reveals, and assign that to the LS MODE key? Then I can just assign "1 MENU" to key 22.0 and that should make pressing the MODE key show my CST menu correct?


Try with the KEYEVAL command, I think that will do what you want.


<< -22.1 KEYEVAL >> 22.2 ASN

<< -22.2 KEYEVAL >> 22.1 ASN

Be sure to include the negative sign on the keycodes in each program.

These assignments will swap MODE and CUSTOM during normal stack operations while you're in USER mode, but not while editing a program.

If you also need them to work while programming, you'll have to put a "TakeOver" command at the beginning of each assignment.


Great, thanks guys! I wasn't aware of the KEYEVAL command.

What does the negative sign do in front of the key numbers Joe?


Just updating in case it helps someone else: I found that the sign of the key specifies which keyboard to use, if the sign is positive it will use the key from the user keyboard while a negative sign in front of the key number will force it to use the default function of that key.


Sean: Thanks, I was wondering about those negative signs myself!

Joe: How does one put a "take over" command in?


Joe: How does one put a "take over" command in?

The easiest way, without needing to know anything about System RPL, is to download the KeyMan library and use its ->TO? command, which takes any object or program and prepends TakeOver onto it.

If you would rather do it yourself, here's a tiny program that does the same thing as the ->TO? command in the KeyMan library. Just place the desired object or program on level 1, and then run this program:


BYTES: 17.5, #EE02h

If the input to the above program is XXX (a single non-program object), then the output is this program:

:: TakeOver XXX ;

If the input is :: XXX YYY ZZZ ; (a program), then the output is this program:

:: Takeover XXX YYY ZZZ ;

I hope that made sense!


Edit: Warning: "TakeOver" is a System RPL command which is INVISIBLE in User RPL, so don't worry if the above SEEMS to have no effect. It does have the intended effect, but you just can't see it on the stack. You can always do a BYTES on the output to verify that it's bigger than the input. Or toggle flag -85 if you're adventurous. ;-)

Edited: 5 Dec 2013, 6:08 a.m.


Thanks, will look forward to trying this out!

Possibly Related Threads...
Thread Author Replies Views Last Post
  Does the HP Prime really compiles the user programs? CompSystems 3 853 12-13-2013, 01:55 PM
Last Post: Mike Morrow
  Broken keys on HP Prime? Tarcisi C 0 447 12-10-2013, 05:59 PM
Last Post: Tarcisi C
  HP Prime - User manual lack bluesun08 6 1,008 11-08-2013, 05:38 PM
Last Post: bluesun08
  HP PRIME : strange behavior when trying user key capability Damien 12 1,384 11-03-2013, 11:02 AM
Last Post: Joe Horn
  [HP-Prime] off-center [0], ... [9] num keys CompSystems 1 448 10-18-2013, 10:44 PM
Last Post: Han
  HP Prime - Home and CAS keys BruceH 0 347 10-15-2013, 07:19 PM
Last Post: BruceH
  HP-Prime Polynomials: User Guide and Request CompSystems 4 709 09-30-2013, 09:48 PM
Last Post: Han
  HP Prime Tip: Setting Up User Keys Eddie W. Shore 2 559 09-27-2013, 09:53 PM
Last Post: Eddie W. Shore
  Where to the 32-bit version of User Code Utiltiy for HP-41 ? Olivier (Wa) 2 494 09-26-2013, 01:55 AM
Last Post: Olivier (Wa)
  Where is the HP Prime User Guide? Steve S 34 2,730 09-20-2013, 10:11 AM
Last Post: Chris Tvergard

Forum Jump: