From: wndalouise@aol.com (WndaLouise)
Newsgroups: comp.sys.hp48
Subject: SuperMagickShiftKeys (New&/orImproved)
Lines: 541
Message-ID: <1998041611513701.HAA25499@ladder01.news.aol.com>
NNTP-Posting-Host: ladder01.news.aol.com
X-Admin: news@aol.com
Date: 16 Apr 1998 11:51:37 GMT
Organization: AOL http://www.aol.com
Xref: republic.btigate.com comp.sys.hp48:9425

Super Magick Shift Keys...!!!
by TinyWanda
WndaLouise@aol.com

>-----------------------------------------:o

You may recall that i posted:
"Magick Shift Keys" here awhile ago...
But regretfully, Magick Shift Keys neglected to consider one important aspect
and potential of the UserKey family of Amazingly Amazing Functions...!
Are there others that are still waiting to be discovered...???

The Three that "Super Magick Shift Keys" Considers, Are:

1) Normal UserKey Assignments!
2) Assignments that act on the VAR Menus & Directories!
3) Assignments that act on the System Menus!  (NEW!)

1) Normal UserKey Assignments!
   These are assignments as defined in the user manuals.
   You simply assign an Object, Function, Commmand or Program
   to a UserKey and it is recalled or evaluated when you access
   that assigned UserKey.

2) Assignments that act on the VAR Menus & Directories!
   These allow you to act on a selected Variable Menu Item within
   HOME or a Users defined directory, without recalling the item to 
   the stack first. 

3) Assignments that act on the System Menus!
   These allow you to assign an Object or Function to a 
   System Menu Key, such as; Assigning a program to the MPH key
   in the Units/Speed menu...!

>-----------------------------------------:o

Contents:

Make     This is the Installer Application
Key->    The Functional Core Program
Usrz?    Returns the assignments of any Normal UserKey
Asn      Assigns a Normal UserKey
Asgn     Assigns a VAR Menu Key
Asgn~    Assigns a SystemMenu Key
Choz     Menu to Choose amoung the Applications
.(up).   The Lists of Magick Key Assignments
Blink    Blinks the Screen for Error Notification
Dup      Makes a Duplicate of a Specified Menu Item
Put      Insert PUT
->P0     Moves a Specified Item to Port Zero

>-----------------------------------------:o
How to Use Them:

Explanations of how to use the Key Assignments are included with their
accompaning assignment applications...
>-----------------------------------------:o

:Make:

To use the Super Magick Shift Keys, 
You have to assign specially created programs to The White Menu UserKeys and
store all these programs somewhere where they can be available at any time, for
any directory, without the user knowing or caring, how or why, the Magick is
working...!!!
Consequently; 
Make automatically---
Stores all these programs into Port 0, 
Creates and places the special UserKey programs
  under the WhiteMenu Keys,
Assigns the Choz Menu to the CST key 
  ( see Choz below for a more detailed explanation )
Then Deletes the remaining hollow directory.

Make takes as Input, A list of the Shifted White Menu Keys that you would like
to dedicate to these extra functions...
That is; Each of The Six White keys are used, But you're allowed to choose
which of the 6 Potential Shift Combinations are used specifially for Super
Magic Shift Keys.
The remaining -unused- Shift combinations can then be used for Normal UserKey
Assignments, or no assignments at all.

The format for this list is to specify the decimal notation for each of the
desired keys...
So that, If you'd like to use the Alpha keys, 
You'd apply this list to the Stack;
{ .4 }
If you'd like to use the Alpha left and Alpha right keys, 
Then that would be;
{ .5 .6 }
Then hit Make.
An Input prompt will appear, 
If the list is already on the stack, Then just hit Enter.

The Six UserKey combinations are:
.1  Unshifted White UserKey
.2  LeftShift White UserKey
.3  RightShift White UserKey
.4  AlphaShift White UserKey
.5  AlphaLeftShift White UserKey
.6  AlphaRightShift White UserKey 

Then:
To use the VAR's Super Magick Shift Keys,
While HOME or a User Defined Directory is displayed,
Hit the selected UserKey combination, Then a White Key,
and the Assigned Program will act on that Object!

To use the SystemMenu's Super Magick Shift Keys,
While a System Menu is displayed,
Hit the selected UserKey combination, Then the White Key,
and the Assigned Program will act on whatever is on the Stack,
( if the Assigned Program is meant to do that (?) ).

See Below to learn how to Assign Objects or Functions 
to these specified Menu keys...

>-----------------------------------------:o

:Key->:

For Super Magick Shift Keys to work, 
A specially created program is installed under each of The White Menu keys,
which is then accessed by a UserKey Shifted combination.
Key-> then takes the Key Position and determines what objects and funtions are
to be acted on, and then does so.
The User is removed from this process, in that 'Key->' is hidden under The
White Menu keys, and recieves the information it needs from the program that
'Make' has written for it.
If you're really curious;
The Input is of the form:
2:   Key Position, 1, 2, 3, 4, 5 or 6 from left to right.
1:   Shifted Notation .1 through .6

If an Error occurs for any reason, The screen will Blink! 

>-----------------------------------------:o

:Usrz?:

UsersKey? is accessed from the Choose Menu that is brought up to the display by
hitting the UserKey Code; Left/Alpha/Left/CST
This Key was selected because that combination, Left/CST will take you to the
Modes Directories, which includes the Keys Directory...???

If you really, really, really, would rather have the Choose Menu Assigned to
another UserKey, Then you'll have to open up 'Make' before you activate it and
change the key code for that bit...! (???)

Anyways...
UsersKey? allows you to see what's under any selected Surface Key...?!
That is; What are the -Normal- UserKey Assignments...???

Select ViewUserKey and when it asks you to "Examine UserKey", 
Simply hit the key that you'd like to examine!
Then all the assignments will be returned to the Stack with Tags!

6:      RC: Assignment  RC is the Row & Column of the selected Key 
5:      <-: Assignment
4:      ->: Assignment  If there's no Assignment;
3:       a: Assignment  An Empty List will be returned.
2:     a<-: Assignment  If the whole Key is Empty, then
1:     a->: Assignment  "No Assignments" is Displayed

>-----------------------------------------:o

:Asn:

Allows you to painlessly Assign a new Object or Function to a Normal UserKey.
Put the Object, Function, Program or 'Name' on the Stack;
1:      Object of somekind
Then select "AssgnUserKey" from the Choose Menu under the CST key;
Left/Alpha/Left/CST
Then, when the "Assign UserKey" prompt comes up, 
Hit the Shift combination and Surface Key that you'd like the Object to be
attached to.

>-----------------------------------------:o

:Asgn:

Assign is used to Assign an Object, Function...ect...to one of your Selected
Shifted White Menu Keys.

Amazingly...!!! After you define a specific function to a given Shifted White
Menu Key for the VAR's Menus, You can still use that Same Shifted Key
combination with the SystemMenus to do something completely different...!!!

After you've assigned a function to the Shifted UserKey combination as
Described Below, That Function will then act on the Object that that White Key
is at that moment Representing...!
You can change the object, the name of the object, bring it to the stack and do
something with it, you can delete it, move it to a port, or examine it and
return a report on what the function has found...!!!

Put the 'Name' of the Function/Program on the stack.
The Object itself has to be stored somewhere where it can be accessed at all
times, such as in a Port, on HOME, or in the mysterious and dangerous, Hidden
Directory...!!!

The function itself is given two arguments;

2:       p  ARealNumberThatIndicatesWhereOn VARS TheObjectWasFound
1:  'Name'  TheNameOfTheSelectedObject

Input for Super Magick Var's Menu Key

1:       'NameOfFuction' 

Bring up the Choose Menu; Left/Alpha/Left/CST
Select "AssgnVarUsrKey"
A prompt will come up for the Program Name, Hit Enter
Then a Choose Menu will ask you which Shift Key combination
  you want to assign the function to...
  REMEMBER: it has to be one of the Shifted Keys 
            that you defined with 'Make'!

Then;
To use the Super Magick Var's Menu Function...
Simply hit the UserKey Combination, 
Then the White Key for the desired Object.
 
>-----------------------------------------:o

:Asgn~:

This is very much like Asgn, and uses the same White Keys, 
in the Same kind of way...
Except...!...that instead of using the Var's User Defined Directories or
HOME...
Asgn~ uses the System Menus and assigns a function/program, or object, to a
particular System Function or Command Key!

The input for these functions is not provided by Key-> as with Asgn.
The input for these are whatever is on the stack, 
or where-ever the function/program can find it...!

To Assign a function to a System Menu Key.
Put the Name of the Function or Object on 1:
Go to the System Menu where the Desired Key is,
Bring up the Choose Menu; Left/Alpha/Left/CST
Select "AssgnSysMenuKey",
The prompt will remind you to have a Program Name on 1:
  and Then direct you to hit The Shift Combination 
  and Desired Menu Key.
REMEMBER:  it has to be one of the Shifted Keys 
           that you defined with 'Make'!

Then;
To use the Super Magick System Menu Function...
Arrange the Stack with whatever input in necessary,
Then Simply hit the UserKey Combination, 
Then the White Key for the desired System Function!

>-----------------------------------------:o

:Choz:

The Choose Menu allows you to Choose any one of the four options associated
with The Super Magick Shift Keys.
The Make Installer will assign this Choose Window Menu to;
The LeftShifted CST UserKey...
If you'd like it to be on some other UserKey, 
Then load the 'Skey' Directory into your 48,
Verify the Checksum with BYTES, 
Open 'Make' with Edit,
and change the 23.2 to something else...???

The four choices are;
ViewUserKey      See Usrz?
AssgnUserKey     See Asn
AssgnVarUsrKey   See Asgn
AssgnSysMenuKey  See Asgn~

>-----------------------------------------:o

:.(up).:

This is the list of Super Magick Shift Key Assignments.
The Format consists of two lists,
The First is the Names of the Objects or Functions to be Evaluated
The Second list are the Key Codes...

The VAR's Menu Codes are different from the System Menu Codes...
Because...
The VAR's codes apply to all the white keys, 
While the System Menu codes apply only to specific Keys...!

The VAR's Key Codes are of the form;
2.000s 
where s is the Shift Designation; 1 through 6

The System Menu Codes are of the form;
mm.ppks
where; 
mm is the Menu Number;      3 through 117
pp is the Page Number;      1 through 99
k is the White Key;         1 through 6
and 
s is the Shift Designation; 1 through 6

Although, there are Menu numbers 0 and 1, and Menu codes for the Ports and
Libraries, Using these Menus will probably result in Errors or Inconsistent
results...???
>-----------------------------------------:o

:Blink:

Blinks the screen, To tell the user that something odd has just happened.

>-----------------------------------------:o

:Dup:

This is a sample program for Asgn ( Var's Menus ).
It makes a duplicate of the object selected, gives it the name of the original
object, plus a middle dot, and returns this copy to the menu, just before the
original object.

>-----------------------------------------:o

:Put:

Works just like PUT, except that it inserts an object into the list, or string,
rather than overwriting the object at the specified position.

>-----------------------------------------:o

:->P0:

Another sample program for Asgn ( Var's Menus ).
Takes the selected object, moves it to Port Zero, and Deletes the original
object from the original directory.

>-----------------------------------------:o


----------------------------------
Name:            Skey
CheckSum:     # 6A8Eh
Size:            2599
----------------------------------

%%HP: T(3)A(D)F(.);
DIR
  Make
    \<<
"1:  {ListOfShifts}"
"" INPUT OBJ\-> 1
OVER SIZE
      FOR \162 1 6
        FOR $ "\<< "
$ " " 4 PICK \162 GET
DUP 5 ROLLD + + +
" :&: Key\-> EVAL \>>"
+ OBJ\-> 10 $ + ROT +
ASN
        NEXT
      NEXT DROP
      \<< :&: Choz
EVAL
      \>> 23.2 ASN {             @ 23.2 refers to the Key Assignment 
\->P0 Put Dup Bl\161nk           @ for the Choz Menu.
\183\|^\183 Choz Asg\241 Asgn    @ which is Left/Alpha/Left/CST
Asn Usrz? Key\-> }               @ Change this at your discretion!
DUP 1
      \<< RCL
      \>> DOLIST SWAP
PURGE { :0: \->P0 :0:
Put :0: Dup :0:
Bl\161nk :0: \183\|^\183 :0:
Choz :0: Asg\241 :0:
Asgn :0: Asn :0:
Usrz? :0: Key\-> }
STO UPDIR 'Skey'
PGDIR
    \>>
  Key\->
    \<< RCLMENU DUP
FP SWAP IP \-> \Ga \Gn \.V
\GD
      \<< :&: \183\|^\183 RCL
EVAL
        CASE \GD 2 <
          THEN :&:
Bl\161nk EVAL DROP2
          END \GD 2
==
          THEN \GD \Gn
.001 * + POS DUP
            \<< GET \.V
100 * 1 - 6 * \Ga +
VARS OVER GET ROT
EVAL
            \>>
            \<< DROP2
:&: Bl\161nk EVAL
            \>> IFTE
          END \GD 2 >
          THEN \GD \.V
\Ga .001 * \Gn .001 * +
+ + POS DUP
            \<< GET
EVAL
            \>>
            \<< DROP2
:&: Bl\161nk EVAL
            \>> IFTE
          END
        END
      \>>
    \>>
  Usrz?
    \<< CLLCD
"  Examine UserKey"
3 DISP
      DO
      UNTIL KEY
      END IP DUP
DUP 10 / DUP IP
SWAP FP 10 * SWAP 1
- ROT 50 <
      \<< 6 *
      \>>
      \<< 5 * 4 +
      \>> IFTE + PATH
# 87927d SYSEVAL
EVAL 'UserKeys' RCL
SWAP EVAL SWAP GET
DUP SIZE
      \<< OBJ\-> DROP 7
ROLL { "\<-" "\->" "\Ga"
"\Ga\<-" "\Ga\->" } + :&:
Tags EVAL
      \>>
      \<< DROP2
"   No Assignments"
5 DISP 1 WAIT
      \>> IFTE
    \>>
  Asn
    \<< CLLCD
"  Assign UserKey"
3 DISP RCLF SWAP
-40 CF 0 WAIT ASN
STOF
    \>>
  Asgn
    \<< RCLF \-> \164
      \<< -55 SF
"1:   'Program'" ""
INPUT OBJ\->
"Select Shift Key"
{ { " \<-\Ga WhiteKey"
.1 } { " \<-\Ga \<-" .2 }
{ " \<-\Ga \->" .3 } {
" \<-\Ga \Ga" .4 } {
" \<-\Ga \Ga\<- " .5 } {
" \<-\Ga \Ga\->" .6 } } 5
CHOOSE
        \<< :0: \183\|^\183
NEWOB DUP RCL NEWOB
OVER PURGE EVAL 2 5
ROLL .001 * + +
SWAP 4 ROLL DTAG
"&" \->TAG + SWAP 2
\->LIST SWAP STO
        \>> :&: Bl\161nk
IFTE \164 STOF
      \>>
    \>>
  Asg\241
    \<< RCLF \-> \164
      \<< -40 CF -55
SF
"1:      'Program'

ThenSelectShift&Key"
CLLCD 2 DISP 0 WAIT
10 - .001 * RCLMENU
+ :0: \183\|^\183 NEWOB DUP
RCL NEWOB OVER
PURGE EVAL 4 ROLL +
SWAP 4 ROLL DTAG
"&" \->TAG + SWAP 2
\->LIST SWAP STO \164
STOF
      \>>
    \>>
  Choz
    \<<
"Magic User Keys" {
{ "ViewUserKey" :&:
Usrz? } {
"AssgnUserKey" :&:
Asn } {
"AssgnVarUsrKey"
:&: Asgn } {
"AssgnSysMenuKey"
:&: Asg\241 } } 1
CHOOSE
      \<< EVAL
      \>> :&: Bl\161nk
IFTE
    \>>
  \183\|^\183 { { :&: Two
:&: Dup } { 94.0225
2.0006 } }
  Bl\161nk
    \<< -56 CF PICT
RCL LCD\-> PICT STO {
# 0d # 0d } PVIEW
PICT NEG RAND 3000
* 500 + .06 WAIT
.03 BEEP TEXT PICT
STO -56 SF
    \>>
  Dup
    \<< VARS 3 ROLLD
DUP RCL SWAP \->STR 1
OVER SIZE 1 - SUB
"\183" + OBJ\-> SWAP
OVER STO Put ORDER
    \>>
  Put
    \<< 3 PICK SIZE \->
a b c z
      \<< a 1 b 1 -
SUB c + a b z SUB +
      \>>
    \>>
  \->P0
    \<< DUP RCL SWAP
DUP PURGE "0" \->TAG
STO DROP
    \>>
END


---------------------------------------
-[terminus]-