888 8 8 8 8 8 8 8 8 8 88 8 888 8 888 888 8 8 888 8 8 8888 888 8 8 8 8 88 8 88 8 8 8 8 8 8 8 8 8 8888 8 8 8 8 88888 8 8 888 8 8 8 8 8 8 8 8 8 8 8 8 8 8888 8 888 8 8 8888 8 8 8 8 888 8 8888 888 by Simone A. Rapisarda Version 1.23 12 July 1992 [Note: If you ever use USER mode, then you need this library! It makes the creation and deletion of key assignments easier, faster, and *far* more powerful. Check it out! -jkh-] The following document is divided into four parts: 1 - Introduction 2 - SmartKeys Commands 3 - Command Usage Examples 3.1 Commands used: IFPRGTE ASNK 3.2 Commands used: STDK IFCMDTE ASNK 3.3 Commands used: KEYN RECK ASNK 3.4 Commands used: PSH EVL IFPRGTE EDIT IFCMDTE 3.5 Command used: SAFE 4 - Some useful information 4.1 The Internal UserKeys list 4.2 Unused and Useless HP48 Default Key Assignments 4.3 Another suggestion for keys-hungry HP48 users 1 - Introduction ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ SmartKeys is a library of utilities designed to increase the power of the already powerful HP48 user keyboard capability. It is a self-attaching library entirely written in system-RPL (mostly using PMC). It's 3391 bytes long and is identified by the library ID 1616. The twenty nine commands it contains were conceived for these fundamental purposes: - Facilitate the usage of key assignments. Commands: ASNK RCLK DELK KEYN PACKKEYS - Increase the speed of user keyboard operations. Commands: ASNK RCLK DELK KEYN PACKKEYS GETKEYS PUTKEYS ADDFR - Save key assignment memory. Commands: ASNK DELK STDK PACKKEYS - Allow special key assignments normally not supported. Commands: STDK RECK EVL PSH EDIT EQW IFCMDTE IFIMMTE IFPRGTE IFALGTE 'BADK - Increase the number of possible assignments on a single key. Commands: IFCMDTE IFIMMTE IFPRGTE IFALGTE DUAL - Fill the gaps in the HP48 default key assignments. Commands: STDK RECK IFCMDTE IFIMMTE IFPRGTE IFALGTE - Allow the usage of more than one user keyboard. Commands: USRM RCUSR STUSR DOUSR DLUSR GETKEYS PUTKEYS - Help the user keyboard always stay active. Command: $CONFIG (hidden) - Provide a way to transform dangerous programs into "Safe" programs. Command: SAFE - Library version number and copyright owner. Command: ABOUTSK - Tree-structured menus Commands: TDIR TDIR NOTES: English is not my native language and it was not one of my favourite subjects at school. I have done my very best to write this document in an understandable form but I might not succeed, so I hope you will excuse the simple words I use and any possible mistake or impropriety. SmartKeys 1.23 has been validated on an HP48 revision E. It should work fine for HP 48 revisions A through E. It may not work correctly for later HP 48 revisions. The SmartKeys library is distributed in the hope that it will be useful; even if its commands have been tested (on a HP48 rev E) they make use of undocumented features, so use them at your own risk: I take no responsibility for any damage caused by their use or misuse. The SmartKeys library and this document are Copyright 1992 by Simone A. Rapisarda. Non-commercial distribution is allowed and encouraged if this document, unchanged, accompanies the unmodified library. The internal SAFE (XLIB 1616 32) and the internal DUAL (XLIB 1616 40) can be extracted and used in other libraries only if these are Public Domain, Freeware or Giftware. This can be done only with my written consent that must be reported in the documentation of the library. I would like to thank the following people: - Joe Horn, Flavia Majlis, Pablo Majlis and Roberto Taddei for their precious help in writing the documentation and their pacience in translating the pieces of my imaginary English into real English. - Flavia Majlis again, who created the beautiful SmartKeys screen displayed by the command ABOUTSK. - Rick Grevelle, for his wonderful HACKIT library that helped me a lot in developing SmartKeys and discovering all the HP48 undocumented features used in it. - Most of the entry points used to compile the SmartKeys library are documented in a list supplied by Jake Schwartz. I thank him and all the contributors to that list. SmartKeys is GiftWare. This means that if after a period of evaluation you find it useful and you think I deserve a contribution for all the time I spent working on it (not a little, believe me!), feel free to send me a gift: cookies, chocolate, cakes, Alka-Seltzer, a 512K ram card etc. ;-). But if you can't afford a gift don't worry; a postcard to the following address will be also welcome: Simone A. Rapisarda via Livia Gereschi 6 56127 PISA ITALY If you have comments, suggestions, questions, criticisms or you just want to say "That's a nice toy!", I would really like to receive Email at the following address: Simone.Rapisarda@p10.f800.n33.z2.fidonet.org 2 - SmartKeys Commands ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ If you aren't familiar with the user keyboard I suggest you first read the Paragraph "The User Keyboard" at page 216 of the HP48 manual. All of the SmartKeys commands other than the obvious ones have examples below. - All the SmartKeys commands *except PUTKEYS* do complete argument checking and are "idiot proof" so it's very unlikely that using them would cause a disaster. However, the evaluation of the programs created by the etc. commands may be catastrophic so always backup your memory unless you know exactly what you are doing. - The built-in commands ASN, STOKEYS and DELKEYS, in my opinion, are not well written. The SmartKeys commands ASNK, DELK and PACKKEYS have been written using some contrivances in order to save a theoretical maximum of 1470 bytes in the internal UserKeys list. If you want to take advantage of this it's best not to use the built-in commands ASN, STOKEYS and DELKEYS at all, and use SmartKeys commands exclusively. - The commands ASNK, RCLK, DELK and STDK(1) support all six possible assignments for all keys, except some combinations of the two shift keys, obviously. - The commands ASNK, RCLK, DELK, GETKEYS, PUTKEYS and PACKKEYS work only on the current UserKeys list. - rc.p represents a real that identifies a key location: r stands for row, c stands for column and p stands for plane. The normal HP 48 keyboard has several keys that behave strangely. For example, the CLVAR key (blue-DEL key), has a built-in safety feature: it doesn't execute immediately, but instead puts itself onto the command line, so that you must then press ENTER if you really want it to execute. This allows you to press ATTN to clear the command line if you pressed CLVAR by mistake. This is therefore called a "safe" key. SmartKeys allows you to create your own safe key assignments and functions. Its own DLUSR command is a safe command. SmartKeys even allows you to create "dual" keys and functions, which are like safe keys except that the action performed from the keyboard is up to you. Many of the SmartKeys commands are dual functions; for example, ABOUTSK displays an "about" screen when pressed from the keyboard; but, when executed from a program (or command line), it places the SmartKeys version string on the stack ("1.23"). Commands in the SmartKeys menus: ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Page 1 ³ Page 2 ³ Page 3 ³ Page 4 ³ Page 5 ³ ÃÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ³ ³ ³ ³ ³ ³ 0 ASNK ³ 6 USRM ³ 12 GETKEYS ³ 18 IFCMDTE ³ 24 ADDFR ³ ³ 1 RCLK ³ 7 STUSR ³ 13 PUTKEYS ³ 19 IFIMMTE ³ 25 'BADK ³ ³ 2 DELK ³ 8 RCUSR ³ 14 EVL ³ 20 IFPRGTE ³ 26 SAFE ³ ³ 3 STDK ³ 9 DOUSR ³ 15 PSH ³ 21 IFALGTE ³ 27 DUAL ³ ³ 4 RECK ³ 10 DLUSR ³ 16 EDIT ³ 22 TDIR ³ 28 ABOUTSK ³ ³ 5 KEYN ³ 11 PACKKEYS ³ 17 EQW ³ 23 TDIR ³ ³ ³ ³ ³ ³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ The following is a description of each of the twenty nine commands contained in the SmartKeys Library. ÚÄÄÄÄÄÄ¿ ³ ASNK ³ (ASsigN Key) ÀÄÄÄÄÄÄÙ (see example below) Needs one argument: (1:Any). Waits for a key to be pressed and assigns the object in level one to that key. If an object is already assigned to that key, the command LASTARG, if active, will push to level one the old assignment. ASNK accepts an empty list instead of the global name 'SKEY' (to force a key to have its standard definition) in order to save keystrokes. ÚÄÄÄÄÄÄ¿ ³ RCLK ³ (ReCalL Key) ÀÄÄÄÄÄÄÙ Needs no arguments. Waits for a key to be pressed and recalls to level one the object assigned to that key. If no object is assigned to that key, the HP48 will just beep. ÚÄÄÄÄÄÄ¿ ³ DELK ³ (DELete Key) ÀÄÄÄÄÄÄÙ Needs no arguments. Waits for a key to be pressed and deletes the assignment of that key. If no object is assigned to that key, the HP48 will just beep. If an object is assigned to that key, the command LASTARG, if active, will push to level one the old assignment. ÚÄÄÄÄÄÄ¿ ³ STDK ³ (recall STandarD Key definition) ÀÄÄÄÄÄÄÙ (see example below) This is a "DUAL" command: (1) When executed from the keyboard: Needs no arguments. Waits for a key to be pressed and recalls the standard assignment of that key. (2) When executed by a running program: Needs one argument: (1:Real). Since not all the standard key assignments can be recalled using method (1), this second way is provided. The Real on level one must be in the same format as required by the built-in command ASN (rc.p). The standard assignment of the specified key is recalled to level one. ÚÄÄÄÄÄÄ¿ ³ RECK ³ (RECord Keys) ÀÄÄÄÄÄÄÙ (see example below) This is a "DUAL" command: (1) When executed from the keyboard: Needs no arguments. Records a sequence of two or more standard keys. The only thing that distinguishes this recording session from the normal state is the message RECK displayed in the status area instead of USER. To finish the recording session you need to press [alpha] [CONT] (key 91.5) or cause an Error (the key that caused the error will not be recorded). At this point a program will be pushed to level one (this will not happen if you have recorded only one key. Use STDK for this), that is the record: its evaluation will cause the key sequence reproduction; it doesn't need to be processed by EVL. For a correct evaluation, assign it to a key or store it in a Global variable. RECK will record every key except those pressed while running a program, even the built-in programs, e.g. the EquationWriter, or the standard editor. For example, while recording, you can edit something but the keys pressed while you are in the editor (*not in the command line*) will not be recorded, and the recording session will restart when you exit from the editor. (2) When executed by a running program: Needs one argument: (1:List). The list must contain more than one Real number in rc.p format: the corresponding key sequence will be created on level one as for (1). The same limitations as for (1) apply. ÚÄÄÄÄÄÄ¿ ³ KEYN ³ (KEY Number) ÀÄÄÄÄÄÄÙ (see example below) Needs no arguments. Asks you to press a key and puts its number in rc format on level one; then you have to press a key between [1] and [6] (any other key will just beep) to complete the result with the key plane so that the real on level one will be in rc.p format. This allows you to get the rc.p key number of any key, including the shifted shift keys. ÚÄÄÄÄÄÄ¿ ³ USRM ³ (USeR keyboards Menu) ÀÄÄÄÄÄÄÙ Needs no arguments, but DOUSR must have been executed beforehand. Displays the User Keyboards Menu created by the command DOUSR. This is a normal menu, similar to the MODES one. It allows you to switch easily and rapidly between all the user keyboards you have created. If USER mode is not active, USRM activates it. ÚÄÄÄÄÄÄÄ¿ ³ STUSR ³ (SelecT USeR keyboard) ÀÄÄÄÄÄÄÄÙ Need one argument: (1:Real) Activates the corresponding User Keyboard. The same result can be obtained by pressing the corresponding named key in the User Keyboards Menu displayed by USRM. If USER mode is not active, STUSR activates it. ÚÄÄÄÄÄÄÄ¿ ³ RCUSR ³ (ReCall USeR keyboard) ÀÄÄÄÄÄÄÄÙ Needs no arguments. Recalls the number of the active User Keyboard and tags it with its name. If there is only one User Keyboard, the result will be a zero tagged with the string "Undefined". ÚÄÄÄÄÄÄÄ¿ ³ DOUSR ³ (DO USeR keyboards) ÀÄÄÄÄÄÄÄÙ Needs one argument: (1:List) It creates as many User Keyboards as specified by the dimension of the list. The only limit to this dimension is the amount of available memory. The memory occupied by an empty UserKeys list is only few bytes. The first object of the list is used to name the current User Keyboard. The other objects are used to name each new keyboard (initially empty). DOUSR will not overwrite an existing User Keyboards menu; if attempted, DOUSR gives the "Object In Use" error. ÚÄÄÄÄÄÄÄ¿ ³ DLUSR ³ (DeLete USeR keyboards) ÀÄÄÄÄÄÄÄÙ This is a "SAFE" command. Needs no arguments. It deletes all the User Keyboards except the current one. DLUSR has no effect if multiple User Keyboards are not defined. DLUSR is required before executing DOUSR if multiple User Keyboards already exist. ÚÄÄÄÄÄÄÄÄÄÄ¿ ³ PACKKEYS ³ ÀÄÄÄÄÄÄÄÄÄÄÙ Needs no arguments. Packs the user key assignments into their most compact form to save memory. As user key assignments are made or deleted using the built-in commands ASN, STOKEYS, and DELKEYS, a certain amount of memory is wasted. You can free this memory for other uses by packing the user key assignment with PACKKEYS. You don't need to PACKKEYS after the SmartKeys commands ASNK and DELK; they pack the key assignments automatically. Note: The command sequence described in the HP 48 Owner's Manual on page 220 [page 15-10 in the newer, single-volume Owner's Manual], RCLKEYS 0 DELKEYS STOKEYS, has a little bug/feature: if the unassigned keys are disabled (by 'S' DELKEYS), after its execution they will be all be enabled. The command PACKKEYS, instead, does not change the unassigned keys state. It also packs the user key assignments into a more compact form almost immediately, unlike the Owner's Manual routine, which is very slow. ÚÄÄÄÄÄÄÄÄÄ¿ ³ GETKEYS ³ ÀÄÄÄÄÄÄÄÄÄÙ Needs no arguments. Pushes to level two the current internal Userkeys list and to level one the real 1 if unassigned keys are enabled or the real 0 if unassigned keys are disabled. For information on the format of the internal Userkeys list refer to paragraph 4.1 of this document. ÚÄÄÄÄÄÄÄÄÄ¿ ³ PUTKEYS ³ ÀÄÄÄÄÄÄÄÄÄÙ Needs two arguments: (2:List, 1:Real). Stores the list on level two as the current internal Userkeys list and the real on level one as the state of unassigned keys: 0 stands for "disabled"; any other number stands for "enabled". For information on the format of the internal Userkeys list refer to paragraph 4.1 of this document. BE CAREFUL: This is a very dangerous command. It doesn't check if the list on level two contains a valid user keyboard (this was done in order to minimize execution time) so the list MUST be in its internally correct format to prevent a disaster. The safest way to use PUTKEYS is only with an internal UserKeys list obtained from GETKEYS (as the arguments obtained from GETKEYS are the same required by PUTKEYS). If you PUTKEYS with a 0 on level 1, your keyboard may lock up. To recover from this situation just press ON-C (only if flag 49 is clear) or press the reset button under one of the rubber feet on the back of the HP48; just pry out the foot and poke a paper clip into the hole. ÚÄÄÄÄÄÄ¿ ³ EVL ³ (make "EVaLuate immediately" program) ÀÄÄÄÄÄÄÙ (see example below) Needs one argument: (1:Any). Leaves on level one a program that when assigned to a key, or stored in a menu, is evaluated immediately, even during command line entry (like the RAD key). ÚÄÄÄÄÄÄ¿ ³ PSH ³ (make "PuSH unevaluated immediately" program) ÀÄÄÄÄÄÄÙ (see example below) Needs one argument: (1:Any). Leaves on level one a program that when assigned to a key, or stored in a menu, pushes the argument unevaluated to the first level of the stack, even during command line entry. ÚÄÄÄÄÄÄÄ¿ ³ EDIT ³ (make "EDIT only" program) ÀÄÄÄÄÄÄÄÙ (see example below) Needs one argument: (1:Any). Leaves on level one a program that when assigned to a key, or stored in a menu, inserts the argument in the Command Line at the position of the cursor. If there is no command line, it is created. ÚÄÄÄÄÄÄ¿ ³ EQW ³ (make "EQuationWriter-able" program) ÀÄÄÄÄÄÄÙ Needs one argument: (1:Any). This is a powerful type of EVL: the object processed by this command and assigned to a key can be executed also while the Equation Writer is active; but remember, the stack *must* always be left intact by the operation. The only part of the display allowed to be affected by such an operation is the menu bar. ÚÄÄÄÄÄÄÄÄÄÄ¿ ³ IFCMDTE ³ (make "IF CoMmanD line Then Else" program) ÀÄÄÄÄÄÄÄÄÄÄÙ (see example below) Needs two arguments: (2:Any, 1:Any). Leaves on level one a program that when evaluated will: - Check if there is a Command Line. - If yes, evaluate the level two argument. - If not, evaluate the level one argument. The resulting program doesn't need to be processed by EVL. ÚÄÄÄÄÄÄÄÄÄÄ¿ ³ IFIMMTE ³ (make "IF IMMediate-entry mode Then Else" program) ÀÄÄÄÄÄÄÄÄÄÄÙ Needs two arguments: (2:Any, 1:Any). Leaves on level one a program that when evaluated will: - Check if the HP48 is in Immediate-Entry Mode. - If yes, evaluate the level two argument. - If not, evaluate the level one argument. The resulting program doesn't need to be processed by EVL. ÚÄÄÄÄÄÄÄÄÄÄ¿ ³ IFPRGTE ³ (make "IF PRoGram-entry mode Then Else" program) ÀÄÄÄÄÄÄÄÄÄÄÙ (see example below) Needs two arguments: (2:Any, 1:Any). Leaves on level one a program that when evaluated will: - Check if the HP48 is in Program-Entry Mode. - If yes, evaluate the level two argument. - If not, evaluate the level one argument. The resulting program doesn't need to be processed by EVL. ÚÄÄÄÄÄÄÄÄÄÄ¿ ³ IFALGTE ³ (make "IF ALGebraic-entry mode Then Else" program) ÀÄÄÄÄÄÄÄÄÄÄÙ Needs two arguments: (2:Any, 1:Any). Leaves on level one a program that when evaluated will: - Check if the HP48 is in Algebraic-Entry Mode. - If yes, evaluate the level two argument. - If not, evaluate the level one argument. The resulting program doesn't need to be processed by EVL. ÚÄÄÄÄÄÄÄ¿ ³ TDIR ³ (make "Temporary DIRectory" program) ÀÄÄÄÄÄÄÄÙ (see example below) Needs one argument: (1:List). The List on level one can be either a complete menu list or a list containing a string and one, two or three complete menu lists. In the first case TDIR creates a key assignment that once evaluated will display the menu specified by the argument. In the second case TDIR creates a menu entry identified by the string as a dir-like menu label, and whose functions (unshifted, left-shifted and right- shifted) are specified by the other list(s). ÚÄÄÄÄÄÄÄ¿ ³ TDIR ³ (extract "Temporary DIRectory" from program) ÀÄÄÄÄÄÄÄÙ Needs one argument: (1:Program). This is a command to reverse the operation of TDIR. It does complete error checking so an invalid input will cause a "Bad Argument Value" error. ÚÄÄÄÄÄÄÄ¿ ³ ADDFR ³ (ADD "FReeze" to a program) ÀÄÄÄÄÄÄÄÙ Needs two arguments: (2:Any, 1:Real). Every time program execution finishes, the whole display is updated. This action often wastes precious time. Many programs do not modify all the display but only a part of it. (e.g. The command SWAP affects only the stack area and not the status and the menu areas of the display; the program \<< -64 SF \>> doesn't affect the display at all). The ADDFR command adds to the object in level two an instruction that freezes the display areas specified by the Real on level one. The real must be used as for the built in command FREEZE. ÚÄÄÄÄÄÄÄ¿ ³ 'BADK ³ (push "BADKey" program onto stack) ÀÄÄÄÄÄÄÄÙ Needs no argument. Pushes on the stack the sys-RPL instruction DoBadKey that is normally associated with all disabled keys. When evaluated it just beeps and freezes the screen. The following two commands are not inherent with the User Keyboard but as they provide two "smartkey" capabilities, they were included anyway. For system-RPL programmers they are also provided in XLIB versions that don't do argument checking. Note that the internal SAFE uses the internal DUAL. ÚÄÄÄÄÄÄ¿ ³ DUAL ³ (branch depending on keyboard or program execution) ÀÄÄÄÄÄÄÙ (see example below) Needs three arguments: (3:Any, 2:Any, 1:String). Note: DUAL is only useful within programs; it is not useful from the keyboard. If the program containing the DUAL command is executed directly (that is, by pressing a menu key or a key to which the program or its name is assigned), DUAL evaluates the argument in level two. Otherwise, if the program isn't executed directly (that is, by being called from within another program), the level three argument will be evaluated. The string on level one must contain the name (Global or XLIB) under which the program is stored. ÚÄÄÄÄÄÄ¿ ³ SAFE ³ (disallow immediate execution of key assignment) ÀÄÄÄÄÄÄÙ (see example below) Needs two arguments: (2:Any, 1:String). Note: SAFE is only useful within programs; it is not useful from the keyboard. SAFE puts the name of the program on the command line if the program is executed directly; otherwise, the level two argument is executed. As for DUAL, the string on level one must contain the name of the program. The built-in CLVAR key (blue-DEL key) is an example of a "safe" key. ÚÄÄÄÄÄÄÄÄÄ¿ ³ ABOUTSK ³ (About SmartKeys) ÀÄÄÄÄÄÄÄÄÄÙ Needs no arguments. This is a "DUAL" command: (1) When executed from the keyboard: Shows the library version and a copyright message. (2) When executed by a running program: Puts on level one the version string of the library (so SmartKeys-based applications can prevent errors). ÚÄÄÄÄÄÄÄÄÄ¿ ³ $CONFIG ³ (Hidden) ÀÄÄÄÄÄÄÄÄÄÙ Needs no argument. It's automatically executed after every system-halt. It checks if the user flag 49 is set; if yes, it sets the system flags -61 ([USR] once to lock) and -62 (User Mode active). So if you wish to stay in USER mode permanently, set flag 49 and the user keyboard will be always active. 3 - Command Usage Examples ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ The following simple examples demonstrate some possible applications of some of the commands contained in the SmartKeys library. 3.1 Commands used: IFPRGTE ASNK When not in Program-Entry Mode the command SWAP is usually executed by pressing [ > ] (key 36.1) so the combination [orange shift] [ > ] serves no purpose. Now you can assign to [orange shift] [ > ] a program that, when in Program-Entry Mode, will insert SWAP in the command line as usual but when in Immediate-Entry Mode will implement an OVER. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³{HOME} ³ ³{HOME} ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³4: ³ ³4: ³ ³3: ³ ³3: ³ ³2: SWAP³ ³2: ³ ³1: OVER³ ³1: ³ ³### ### ### ### ### ###³ ³### ### ### ### ### ###³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 1) Enter the list { SWAP 2) Press IFPRGTE to OVER } and press OBJ obtain the new assignment. followed by DROP to obtain Press ASNK and then the two commands unevaluated. the [orange shift] [ > ] key to assign it to that key. 3.2 Commands used: STDK IFCMDTE ASNK The [DEL] key serves no purpose when there isn't a command line. Now you can assign to it a program that when the command line is not present will execute LASTARG, otherwise it will behave like the normal [DEL] key. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³{HOME} ³ ³{HOME} ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³4: ³ ³4: ³ ³3: ³ ³3: ³ ³2: External External ..³ ³2: ³ ³1: LASTARG³ ³1: ³ ³### ### ### ### ### ###³ ³### ### ### ### ### ###³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 1) Press STDK and then 2) Press IFCMDTE to [DEL] to recall the key obtain the new [DEL] key routine. Enter the list assignment. Press ASNK { LASTARG } and press and then the [DEL] key to OBJ DROP to obtain the assign the program in level LASTARG command. one to it. 3.3 Commands used: KEYN RECK ASNK Usually in order to enter a string you need to use the alpha keyboard so every time it takes four (or three) keystrokes: [blue-shift] [ - ] [alpha] ( [alpha] ) Now you can assign to the key [blue-shift] [ - ] a program that automatically enters the alpha keyboard. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³{HOME} ³ ³{HOME} ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³4: ³ ³4: ³ ³3: ³ ³3: ³ ³2: ³ ³2: ³ ³1: { 85.3 61.4 }³ ³1: ³ ³### ### ### ### ### ###³ ³### ### ### ### ### ###³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 1) Enter an empty list, then 2) Press [ENTRY], [RECK] and press KEYN and then [ENTER] to convert the list [ - ] and [ 3 ] so to obtain on level one to the the real number 85.3, press corresponding keys sequence. [ + ]. Then press KEYN, Finally press ASNK and [alpha], [ 4 ] so to obtain the press the [blue-shift] [ - ] real number 61.4, press [ + ]. key so that the program (If you keep flag -60 set, in level one is assigned to use 61.1, not 61.4). that key. 3.4 Commands used: PSH EVL IFPRGTE EDIT IFCMDTE Now it's time to build yourself the silliest key assignment ever seen: It checks if there is the command line and: - if not, it will start the command line with the string "STARTcmd". - if yes, it checks if Program-Entry Mode is active and: - if yes, it will push to the first level the string "PRGon". - if not, it will evaluate the program \<< "PRG" "off" + \>>. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³{HOME} ³ ³{HOME} ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³4: ³ ³4: ³ ³3: ³ ³3: ³ ³2: ³ ³2: "PRGon"³ ³1: "PRGon"³ ³1:\<< "PRG" "off" + \>>³ ³### ### ### ### ### ###³ ³### ### ### ### ### ###³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 1) Enter the string "PRGon" 2) Enter the program \<< "PRG" and press PSH to "off" + \>> and press make it pushable. EVL to make it evaluable. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³{HOME} ³ ³{HOME} ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³4: ³ ³4: ³ ³3: ³ ³3: ³ ³2: ³ ³2: External External ..³ ³1: External External ..³ ³1: "STARTcmd" Externa..³ ³### ### ### ### ### ###³ ³### ### ### ### ### ###³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 3) Press IFPRGTE. 4) Enter the string "STARTcmd" and press EDIT to make it editable. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³{HOME} ³ ³{HOME} ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³4: ³ ³4: ³ ³3: ³ ³3: ³ ³2: ³ ³2: ³ ³1: External External ..³ ³1: ³ ³### ### ### ### ### ###³ ³SILLY #################³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 5) Press IFCMDTE to 6) I don't think you want to obtain your brand new waste a key for such a smart key. stupid assignment so: Enter the string "SILLY", implement SWAP 2 LIST 1 LIST to store the program and the string in a menu and finally press TMENU. 3.5 Command used: SAFE The following is a Safe program that purges the graphic display: %%HP: T(3); \<< \<< PICT PURGE \>> @ The 'dangerous' code. "PPICT" @ The name used to store this entire program. SAFE \>> Download (or type in) this program and store it with the name 'PPICT'. 3.6 Command used: DUAL The following is a "dual" program that puts "From Keyboard" on level 1 if executed from the keyboard, or "From Program" if executed from a program: %%HP: T(3); \<< "From Program" @ the code to execute if called by a program "From Keyboard" @ the code to execute if called from keyboard "EX3.6" @ the name used to store this entire program DUAL \>> Download (or type in) this program and store it with the name 'EX3.6'. If you press the 'EX3.6' menu key, you'll see "From Keyboard". But press << EX3.6 >> ENTER, then EVAL will produce "From Program". 3.7 Command used: TDIR The following program, once downloaded to a 48 and evaluated will put two silly menu entries on the stack. Do TDIR on each one to obtain two dir-like menu entries, then finally execute 2 LIST TMENU and take a look at the menu that will be displayed. (Remember that the LAST MENU key can be pressed to "back up" to the "temporary directory" menu after pressing NUMB or ALPHA). %%HP: T(3); { @ begin 1st menu entry "NUMB" @ the 1st menu label { 1 2 3 4 5 } @ the menu displayed by the 1st unshifted key { -1 -2 -3 -4 -5 } @ the menu displayed by the 1st left-shifted key } @ end 1st menu entry { @ begin 2nd menu entry "ALPHA: Alphabet" @ the 2nd menu label { A B C D E F G H } @ the menu displayed by the 2nd unshifted key { I J K L M N O P } @ the menu displayed by the 2nd left-shifted key { Q R S T U V W X } @ the menu displayed by the 2nd right-shifted key } @ end 2nd menu entry 4 - Some useful information ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 4.1 The Internal UserKeys list When no keys are assigned to the user keyboard, the internal UserKeys list is empty. When one or more assignments are active, the internal UserKeys list contains forty nine lists, each of which can be an empty list (if the key has no assignments) or a six element list (if the key has one or more assignments). Each of these six elements is the object assigned to the key in keyplane order, or an empty list if that keyplane has no assignment. Example: Assuming that no keys are assigned, when you assign the command % to the key DEF your internal UserKeys list will look like this: { {} {} {} {} {} {} {} {} {} {} {} {} {} {{}%{}{}{}{}} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} {} } 4.2 Unused and Useless HP48 Default Key Assignments In order to take full advantage of the SmartKeys library you may want to know what the gaps in the HP48 default key assignments are, so you can fill them with your own key definitions. If so, the following table will help you. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³UNUSED AND USELESS HP48 DEFAULT KEY ASSIGNMENTS v 1.1³ ÃÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ ENTRY ³³ UNUSED ³³ ? USELESS ? ³ ³ MODE ³ÃÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÅÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ´ ³ ³³ NUMB ³ SPECIFICAT. ³³ NUMBER ³ SPECS ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´ ³ IMMEDIATE ³³ 25.3 ³ BlShft-up ³³ 34.1or2 ³ GRAPH ³ ³ ENTRY ³³ 34.3 ³ BlShft-left ³³ 36.1or2 ³ SWAP ³ ³ MODE ³³ 36.3 ³ BlShft-right ³³ 55.1or2 ³ DROP ³ ³ & NO ³³ 51.4 ³ alpha-ENTER ³³ 91.2or5 ³ CONT ³ ³ COMMAND ³³ 54.1 ³ DEL ³³ 91.3or6 ³ OFF ³ ³ LINE ³³ 54.4 ³ alpha-DEL ³³ 92.3 ³  ³ ³ ³³ 55.4 ³ alpha-BckSpc ³³ 93.2 ³ , ³ ³ ³³ 62.5 ³ ` accent ³³ 93.3 ³ <-' ³ ³ ³³ 62.6 ³ ' accent ³³ 94.1 ³ SPC ³ ³ ³³ 63.5 ³ ^ accent ³³ 94.3 ³ \<) ³ ³ ³³ 63.6 ³ ~ accent ³³ ³ ³ ³ ³³ 64.5 ³ " accent ³³ ³ ³ ³ ³³ 64.6 ³ etc. accent ³³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´ ³ IMMEDIATE ³³ ³ ³³ 34.2 ³ GRAPH ³ ³ ENTRY ³³ ³ ³³ 36.2 ³ SWAP ³ ³ MODE ³³ ³ ³³ 55.2 ³ DROP ³ ³ & ³³ ³ ³³ 91.2or5 ³ CONT ³ ³ COMMAND ³³ ³ ³³ 91.3or6 ³ OFF ³ ³ LINE ³³ ³ ³³ 92.3 ³  ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄ´ ³ PROGRAM ³³ 52.3 ³ VISIT ³³ 51.2or3 ³ DUP ³ ³ ENTRY ³³ 53.2 ³ 2D ³³ 91.2or5 ³ CONT ³ ³ MODE ³³ 53.3 ³ 3D ³³ 91.3or6 ³ OFF ³ ³ ³³ 62.3 ³ solver ³³ ³ ³ ³ ³³ 64.3 ³ eq catalog ³³ ³ ³ ³ ³³ 72.3 ³ alrm catalog ³³ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÁÁÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÁÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÙ 4.3 Another suggestion for keys-hungry HP48 users The following method is somewhat tricky and requires a little familiarity with system-RPL but will allow you to gain four unshifted 'keys' and a lot of shifted keys on your user keyboard. If you press the key MTH, PRG, CST or VAR the corresponding menu will be displayed, but now you will not need that key any more, so you can use this key for your own purpose. To do this you have to assign to it a simple system-RPL program that will check if the menu is displayed, if not it will display it, if yes it will do something else (the best thing would be to display another menu). Examples: 1) I use frequently the library menu and I don't like to press two keys to reach it so I created an assignment for the key CST that allow me to toggle between the two menus as described by the following scheme: ÚÄÄÄ>>ÄÄÄ CUSTOM menu ÄÄÄÄ>>ÄÄÄ¿ ³ ³ Press [CST] Press [CST] ³ ³ ÀÄÄÄ<<ÄÄÄ LIBRARY menu ÄÄÄ<<ÄÄÄÙ If I press [CST] once the Custom menu will be displayed but if I press it twice the Library menu will be displayed (and so on). It follows the system-RPL program in ASC format. %%HP:; "D9D20A5804432B34A8143A4467A226B58147A22664B308DA16F6EA327BA3AC1A 3B2130A1D7" 2) It's common knowledge that libraries are better than directories and so, when it's possible, I use libraries, but in many cases I can't. For this reason my dir-tree is somewhat immense. Every time I move into it I hate to press [orange-shift] [UPDIR] or [blue-shift] [HOME] so I've tried to find a solution to this. The following two programs work like the preceding one but instead of toggling between two menus they toggle between a menu and an instruction. The way to implement this is more tricky but as in the preceeding example the resulting programs are easily modifiable. The following program must be assigned to the MTH key. It toggles between the MTH menu and the UPDIR instruction. %%HP:; "D9D20A5804432B34A8143A44698226DA916D9D2075DA3AC1A3B213079E60B51A 15E4049B314AC1A3B2130CADF" The following program must be assigned to the PRG key. It toggles between the PRG menu and the HOME instruction. %%HP:; "D9D20A5804432B34A8143A44635040A3D36D9D20A1EA3AC1A3B213079E60041A 15E4049B314AC1A3B21307CAD" <><><><><><><><><><><><><><> Happy Assigning RAP