| Previous | Contents | Index |
SET WINDOW KEYSTROKE str_expr1: VALUE str_expr2
|
| Example 11-52 SET WINDOW KEYSTROKE: VALUE Statement |
|---|
print 'Saving the current keymap.' ask window: keymap old_keymap$ set window: keymap '' print 'Changing dollar sign key to *' set window keystroke '$': value '*' line input 'Press the dollar sign key, then ENTER': e$ print 'Restoring saved keymap.' set window: keymap old_keymap$ line input 'Press the DOWN key': down$ line input 'Press the dollar sign key, then ENTER' : e$ end Saving the current keymap. Changing DOWN key to be the EXIT key Press the DOWN key? EXIT Changing dollar sign key to * Press the dollar sign key, then ENTER? * Restoring saved keymap. Press the DOWN key? Press the dollar sign key, then ENTER? $ |
SET WINDOW KEYSTROKE changes the meaning of a keystroke within a Sheerpower program. This allows complete redefinition of the keyboard for a given application.
str_expr1 describes the name of a key to be changed. It can be a single keystroke name or a comma-separated list of names. Keystroke names can be a single letter, or the name of the letter (such as [Tab], or [Ctrl/Z]).
str_expr2 defines the new meaning of the keystroke. A keystroke meaning consists of one or two components: the keystroke value and the keystroke concept. For example, the [Ctrl/Z] key usually has a value of CHR$(26), and the concept of EXIT. The keystroke value and/or the keystroke concept can be changed. If changing both a value and a concept, separate the two with a comma. You can restore the original meaning of the key by using " ".
The following keystroke concepts are supported:
| Concept name | Description |
|---|---|
| _EXIT | an EXIT key |
| _BACK | a BACK key |
| _HELP | a HELP key |
| _IGNORE | ignore this keystroke |
| _INVALID | beep when pressed |
| _TERMINATOR | keystroke is a line terminator |
ASK WINDOW: ROW num_var
|
| Example 11-53 ASK WINDOW: ROW Statement |
|---|
print at 5,10:; ask window: row cur_row print 'Cursor is at row'; cur_row end Cursor is at row 5 |
ASK WINDOW: ROW statement returns the current row of the cursor's position.
SET WINDOW: ROW num_expr
|
| Example 11-54 SET WINDOW: ROW Statement |
|---|
set window: row 3 print 'Hi!' end Hi! |
SET WINDOW: ROW statement positions the cursor at the num_expr row within the current column.
ASK WINDOW: TYPEAHEAD str_var
|
| Example 11-55 ASK WINDOW: TYPEAHEAD Statement |
|---|
do
do_process
ask window: typeahead z$
if pos(ucase$(z$), 'STA') > 0 then show_status
if pos(z$, chr$(26)) > 0 then exit do
loop
stop
routine do_process
delay 1 //<--- simulated processing
print '.';
end routine
routine show_status
print
print 'Showing status'
set window: typeahead ''
end routine
end
....... <---- type 'STA' while dots are printing
showing status
....... [Ctrl/Z] <---- to stop, press [Ctrl] and [z]
|
ASK WINDOW: TYPEAHEAD gets data from the typeahead buffer. This statement can be used to determine, for example, whether the user has typed [Ctrl/Z] or other special keystrokes. Asking for typeahead data does not lose what is already in the typeahead buffer.
SET WINDOW: TYPEAHEAD str_expr
|
| Example 11-56 SET WINDOW: TYPEAHEAD Statement |
|---|
set window: typeahead 'FRED' + chr$(13) input 'Name': name$ print name$ end Name? FRED FRED |
SET WINDOW: TYPEAHEAD puts data into the typeahead buffer as though the user had typed the data in from the terminal.
11.17 ASK | SET ZONEWIDTH
11.17.1 ASK ZONEWIDTH
ASK ZONEWIDTH num_var
|
| Example 11-57 ASK ZONEWIDTH Statement |
|---|
ask zonewidth x print 'The current print zone width is'; x end The current print zone width is 20 |
ASK ZONEWIDTH finds the print zone width of the device specified and assigns the value to the numeric variable, num_var.
SET ZONEWIDTH num_expr
|
| Example 11-58 SET ZONEWIDTH Statement |
|---|
print 1,2,3
set zonewidth 10
print 1,2,3
set zonewidth 20
end
1 2 3
1 2 3
|
SET ZONEWIDTH sets the print zone width of the device specified to the number designated. num_expr indicates the width to set the device's print zones.
| Previous | Next | Contents | Index |