120
7.2 Input from the Keyboard
7.2.1 Function Keys
Any of the following operations makes the pressed key act as a function key:
- Pressing one of the function keys.
*1
- Pressing one of the function keys while holding down the Shift key.
*2
- Pressing one of the numeric keys while holding down the Shift key.
*2
*1
Since each of the function keys is assigned its default value of a character code
or control code, pressing it enters the default value. New assignment is possible
with a KEY statement as described below.
*2
If pressed with the Shift key held down, not only the function keys but also
numeric keys serve as function keys.
For the keyboard layouts, key numbers, and key assignments, refer to Appendix E, "Key Num-
ber Assignment on the Keyboard."
■
Assigning a character string to a function key
You can assign a desired character string (up to two characters) or a single control code to a
function key by using the
KEY statement, as shown below.
- Example for characters
KEY 1,"AB"
- Example for a control code
KEY 2,CHR$(8) ‘-Backspace
Where a backspace code is assigned to the function key numbered 2.
NULL Character or String Assignment
Assigning a NULL character or string to a function key makes the entry of that function key
invalid if pressed. In the example below, pressing the keys numbered 3 and 4 produces no
keyboard entry.
KEY 3,""
KEY 4,CHR$(0)
Comentários a estes Manuais