This is an old revision of the document!
ASNKEY
Synopsis
Assign custom action to a key
Description
The ASNKEY command assigns a custom behavior to any key in the keyboard. It takes 3 arguments:
- Level 3 - Action: Defines what the key will do when pressed. It can be one of the following:
- Any RPL object: RPL Objects will be placed on he stack and evaluated with the
XEQcommand. While in the editor, they will be decompiled and inserted as text. Some RPL objects will be handled as special cases, as detailed in the following items. - « …Program… »: A standard RPL program that will be executed. While in any context it will close the context and return to the regular stack, just as if the program had been typed into the command line and the user pressed EN
- :: …Program… ;: An RPL program that will be executed transparently, it will not close the context or modify the user interface. The main difference between a normal program and a transparent one is that for example when executed in the text editor context, the program can modify the command line using any of the editor commands to move the cursor, delete or insert text, etc.
- { “String” }: A list with a single string will be considered a symbol. The insert the string in the editor. It will open the editor if in any other context.
- { Command }: A list with a single command will execute the command following the same rules as the soft menu keys for commands. While the user is in the stack, the command will be executed. When the user is in the editor the command will do different things depending on the cursor mode. In direct mode (D) it will execute the command, in algebraic input mode A it will insert the command name in the editor, and finally in programming mode (P) it will insert the command with spaces as if writing an RPL program.
- Level 1 - Context: This is an integer that defines the context in which the key will be active. The lowest 5 bits are a sub-context number (0-31), the upper bits are the context number. The context changes when the user is interacting with the user interface. So far there's 2 different contexts defined in newRPL: Context 0 is the normal user interface, and Context 32 (#20h) is active when the UI is in Forms mode (not yet implemented as of this writing). The sub-context bits define which part of the interface the user in currently interacting, and can be one of the following:
- 0 = Match any sub-context
- 1 = The user is using the editor
- 2 = The user is using the stack
- 4 = The user is using the interactive stack
- 8 = The user is using the interactive function plot (not yet implemented)
- 16 = The using is using the interactive picture mode (not yet implemented)
Compatibility
→∡° is specific to newRPL and has no direct equivalent in userRPL.
Usage
Input
4: 3: 2: 1: 45 ………………………………………………………………………………………………………… →∡°
Output
4:
3:
2:
1: ∡45°
…………………………………………………………………………………………………………
Related Commands
| Command | Short Description | |
|---|---|---|
| →∡° | Mark a number as an angle in degrees | NEW |
| →∡r | Mark a number as an angle in radians | NEW |
| →∡g | Mark a number as an angle in grads (gons) | NEW |
| →∡d | Mark a number as an angle in DMS (DD.MMSS) | NEW |
| A→∡° | Convert an angle to degrees | NEW |
| A→∡r | Convert an angle to radians | NEW |
| A→∡g | Convert an angle to grads (gons) | NEW |
| A→∡d | Convert an angle to DMS (DD.MMSS) | NEW |
| →RECT | Convert vector or complex to cartesian coordinates | NEW |
| →POLAR | Convert vector or complex to polar coordinates | NEW |
| →SPHER | Convert vector or complex to spherical coordinates | NEW |