Intermec PB51 Fingerprint Developer's Guide (old) - Page 128

Defining Audio Beeps With KEY BEEP, Entering ASCII Characters With INPUT#, INPUT$, or LINE INPUT#

Page 128 highlights

Chapter 7 - Controlling the Printer For the KEY...ON command, keys are specified by identification (id.) numbers. Each key has two id. numbers, one for its unshifted position and another for its shifted position. The id. number of the shifted key is equal to its unshifted id. number + 100. For example, the F1 key has id. number 10 in unshifted position, but id. number 110 in shifted position. If a key is remapped, its id. number follows the key to its new position. In the following example, F1 and F2 are enabled and used to branch to different subroutines. The keys are specified by their id. numbers (10 and 11 respectively): 10 20 30 40 50 1000 1010 2000 2010 RUN ON KEY (10) GOSUB 1000 ON KEY (11) GOSUB 2000 KEY (10) ON: KEY (11) ON GOTO 40 END PRINT "You have pressed F1" RETURN 50 PRINT "You have pressed F2" RETURN 50 Defining Audio Beeps With KEY BEEP Each time a key is pressed, the printer beeps (a 1200 Hz tone for 0.030 seconds). The frequency and duration of the signal can be globally changed for all keys using a KEY BEEP statement. Setting the frequency to a value higher than 9999 turns off the beep for all keys. Entering ASCII Characters With INPUT#, INPUT$, or LINE INPUT# Provided "console:" is OPENed for sequential INPUT, the keys can be used to enter ASCII characters to the program. For more information and an example, see "Input From a Random File" on page 50. Remapping the Keypad With KEYBMAP$ Printer keypads are fully remappable (exception for the Shift key), using the KEYBMAP$ command. Each key can produce two ASCII characters (shifted and unshifted). Mapping also decides the id. numbers for the keys. The basis of the remapping process is the position number of each key. For more information, see "Character Sets and Keywords" on page 153. Note: KEYBMAP$ instructions do not affect the printer in Setup Mode. The current keyboard mapping can be read to a string variable using the KEYBMAP$ command. This example reads the unshifted characters on the keyboard of a PF4i. Non-existing key positions get ASCII value 0: 10 PRINT "Pos","ASCII","Char." 20 A$=KEYBMAP$(0) 30 FOR B%=1 TO 64 40 C$=MID$(A$,B%,1) 50 E%=ASC(C$) 60 PRINT B%,E%,C$ 112 Intermec Fingerprint Developer's Guide

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187

Chapter 7 — Controlling the Printer
112
Intermec Fingerprint Developer’s Guide
For the KEY...ON command, keys are specified by identification (id.) numbers. Each
key has two id. numbers, one for its unshifted position and another for its shifted
position. The id. number of the shifted key is equal to its unshifted id. number +
100. For example, the
F1
key has id. number 10 in unshifted position, but id.
number 110 in shifted position.
If a key is remapped, its id. number follows the key to its new position.
In the following example, F1 and F2 are enabled and used to branch to different
subroutines. The keys are specified by their id. numbers (10 and 11 respectively):
10
ON KEY (10) GOSUB 1000
20
ON KEY (11) GOSUB 2000
30
KEY (10) ON: KEY (11) ON
40
GOTO 40
50
END
1000
PRINT “You have pressed F1”
1010
RETURN 50
2000
PRINT “You have pressed F2”
2010
RETURN 50
RUN
Defining Audio Beeps With KEY BEEP
Each time a key is pressed, the printer beeps (a 1200 Hz tone for 0.030 seconds). The
frequency and duration of the signal can be globally changed for all keys using a
KEY BEEP statement. Setting the frequency to a value higher than 9999 turns off
the beep for all keys.
Entering ASCII Characters With INPUT#, INPUT$, or LINE INPUT#
Provided “console:” is OPENed for sequential INPUT, the keys can be used to enter
ASCII characters to the program. For more information and an example, see
“Input
From a Random File” on page 50.
Remapping the Keypad With KEYBMAP$
Printer keypads are fully remappable (exception for the
Shift
key), using the
KEYBMAP$ command. Each key can produce two ASCII characters (shifted and
unshifted). Mapping also decides the id. numbers for the keys.
The basis of the remapping process is the position number of each key. For more
information, see
“Character Sets and Keywords” on page 153.
The current keyboard mapping can be read to a string variable using the
KEYBMAP$ command. This example reads the unshifted characters on the
keyboard of a PF4i. Non-existing key positions get ASCII value 0:
10
PRINT “Pos”,“ASCII”,“Char.”
20 A$=KEYBMAP$(0)
30
FOR B%=1 TO 64
40 C$=MID$(A$,B%,1)
50 E%=ASC(C$)
60
PRINT B%,E%,C$
Note:
KEYBMAP$ instructions do not affect the printer in Setup Mode.