AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
=>     R0 =     221-228 (&DD - &E5)     controls range of buffer codes affected
     R1 =     EOR value
     R2 =     AND value

<=     R0 preserved
     R1 =     previous value
     R2 corrupted

This call reads or sets the interpretation of input values &80-&FF, which includes codes generated by the function keys. The 128 buffer codes are divided into 8 blocks, and the block affected is chosen by R0. The value generated via R1 and R2 determines the interpretation of buffer codes:

Value     Interpretation

0     discard
1     expand function key number (code MOD 16)
2     insert 0 byte followed by code
3-255     insert (code MOD 16) + value

See PRM 1, page 891
OS_Byte 221-228 key codes
Function keys generate these codes unshifted

Key          Code

Print          &80
F1-F9          &81-&89
Copy          &8B
Left          &8C
Right          &8D
Down          &8E
Up          &8F
Page down     &9E
Page up          &9F
F10-F12          &CA-&CC
Insert          &CD

Shift EORs the code with &10
Control EORs the code with &20

The cursor keys and copy only generate these codes if set up to act as function keys by calling OS_Byte 4 with R1=2.

&80 + Buffer value gives the character codes used by the Wimp. When reset occurs &CA (i.e. F10) is inserted into the input buffer.

Unlisted codes cannot be generated by the main keyboard, but can occur by
·     Using these OS_Byte calls to set keys to generate them
·     Changing the numeric keypad base with OS_Byte 238
·     Inserting bytes into the keyboard buffer with OS_Byte 138 and 153.
·     Receiving bytes from the serial port (see also OS_Byte 181 to control serial input interpretation)

Note that page up and down effectively behave as Up and Down with shift toggled. In fact, it is impossible to distinguish shift/control combinations of page up and down with shift/control combinations of cursor up and down, which can prove frustrating.
OS_Byte 221-228 ranges
R0     Range affected     Default value     Effect

221     &C0-&CF          1          function keys (Print, F1-F9, cursor keys and copy if acting as function keys)
222     &D0-&FF          &80          return buffer code - 16
223     &E0-&FF          &90          return buffer code - 16
224     &F0-&FF          0          discard
225     &80-&8F          1          function keys (F10-F12, Insert)
226     &90-&9F          &D0          return buffer code
227     &A0-&AF          &E0          return buffer code
228     &B0-&BF          &F0          return buffer code

[sh-index] Back to list of manuals