Difference between revisions of "SET KEY TO"

From Recital Documentation Wiki
Jump to: navigation, search
Line 1: Line 1:
=SET KEY TO=
 
 
 
 
==Class==
 
==Class==
 
Keyboard Events
 
Keyboard Events
Line 15: Line 12:
  
 
==See Also==
 
==See Also==
[[@...GET]], [[@...MENU]], [[KEYBOARD]], [[SET KEY]], [[CTRL()]]
+
[[@...GET]], [[@...MENU]], [[@...SAY]], [[APPEND]], [[CHANGE]], [[CTRL()]], [[EDIT]], [[FMT()]], [[Function Keys]], [[INSERT]], [[KEYBOARD]], [[QUERY]], [[READ]], [[SET FORMAT]], [[SET KEY]]
  
  
Line 21: Line 18:
 
The SET KEY TO <expN> command is used in custom screen formats to map a menu option to a function or control key.
 
The SET KEY TO <expN> command is used in custom screen formats to map a menu option to a function or control key.
  
A screen format file, which is activated with the SET FORMAT TO <.fmt filename> command, can contain a form definition using @…SAY...GET commands, and can also contain a menu definition using @...MENU commands.  When the form is activated by one of the full screen forms based commands APPEND, CHANGE, EDIT, INSERT, QUERY or READ, the form is displayed on the screen and data input mode is entered.  If the [MENUBAR] key is pressed, then any @…MENU commands which have been defined in the screen format file are activated.  You can then specify the SET KEY TO <expN> command as the command on the @...MENU command.
+
A screen format file, which is activated with the SET FORMAT TO <.fmt filename> command, can contain a form definition using @...SAY...GET commands, and can also contain a menu definition using @...MENU commands.  When the form is activated by one of the full screen forms based commands APPEND, CHANGE, EDIT, INSERT, QUERY or READ, the form is displayed on the screen and data input mode is entered.  If the [MENUBAR] key is pressed, then any @...MENU commands which have been defined in the screen format file are activated.  You can then specify the SET KEY TO <expN> command as the command on the @...MENU command.
  
 
If you issue the SET KEY TO -1 command, activated from a menu selection, the menu will be exited.  The CTRL() function is often used with the SET KEY TO command.  The Screen Painter, initiated with the CREATE SCREEN command, allows menu items to be built into forms.
 
If you issue the SET KEY TO -1 command, activated from a menu selection, the menu will be exited.  The CTRL() function is often used with the SET KEY TO command.  The Screen Painter, initiated with the CREATE SCREEN command, allows menu items to be built into forms.
  
NOTE: It is important to distinguish this command from the following command (SET KEY <expN> TO <procedure name>), which has a different purpose.  An alternative to the SET KEY command is to use the KEYBOARD command.
+
NOTE: It is important to distinguish this command from the [[SET KEY|SET KEY <expN> TO <procedure name>]] command, which has a different purpose.  An alternative to the SET KEY command is to use the KEYBOARD command.
  
  
 
==Example==
 
==Example==
<pre>
+
<code lang="recital">
 
// Dataentry.fmt
 
// Dataentry.fmt
 
@0,0 say  "Next"
 
@0,0 say  "Next"
 
@0,0 menu "Next";
 
@0,0 menu "Next";
command "set key to ctrl(’n’)"
+
  command "set key to ctrl(’n’)"
 
@0,5 say  "Prev"
 
@0,5 say  "Prev"
 
@0,5 menu "Prev";
 
@0,5 menu "Prev";
command "set key to ctrl(’r’)"
+
  command "set key to ctrl(’r’)"
 
// The form would now be defined
 
// The form would now be defined
 
return
 
return
Line 49: Line 46:
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Commands]]
 
[[Category:Commands]]
[[Category:Set_Commands|KEY TO]]
+
[[Category:Set_Commands|KEY TO]]</code>

Revision as of 13:11, 16 April 2009

Class

Keyboard Events


Purpose

Map a menu option to a control or function key in a form


Syntax

SET KEY TO <expN>


See Also

@...GET, @...MENU, @...SAY, APPEND, CHANGE, CTRL(), EDIT, FMT(), Function Keys, INSERT, KEYBOARD, QUERY, READ, SET FORMAT, SET KEY


Description

The SET KEY TO <expN> command is used in custom screen formats to map a menu option to a function or control key.

A screen format file, which is activated with the SET FORMAT TO <.fmt filename> command, can contain a form definition using @...SAY...GET commands, and can also contain a menu definition using @...MENU commands. When the form is activated by one of the full screen forms based commands APPEND, CHANGE, EDIT, INSERT, QUERY or READ, the form is displayed on the screen and data input mode is entered. If the [MENUBAR] key is pressed, then any @...MENU commands which have been defined in the screen format file are activated. You can then specify the SET KEY TO <expN> command as the command on the @...MENU command.

If you issue the SET KEY TO -1 command, activated from a menu selection, the menu will be exited. The CTRL() function is often used with the SET KEY TO command. The Screen Painter, initiated with the CREATE SCREEN command, allows menu items to be built into forms.

NOTE: It is important to distinguish this command from the SET KEY <expN> TO <procedure name> command, which has a different purpose. An alternative to the SET KEY command is to use the KEYBOARD command.


Example

// Dataentry.fmt
@0,0 say  "Next"
@0,0 menu "Next";
  command "set key to ctrl(’n’)"
@0,5 say  "Prev"
@0,5 menu "Prev";
  command "set key to ctrl(’r’)"
// The form would now be defined
return
 
use patrons index events, dates, names
set format to dataentry
change</pre>
 
 
==Products==
Recital Mirage Server, Recital Terminal Developer
[[Category:Documentation]]
[[Category:Commands]]
[[Category:Set_Commands|KEY TO]]