Date : Thu, 04 Jan 2001 11:41:47 +0000
From : jgh@... (Jonathan Graham Harston)
Subject: INKEY function
Ben Newsam <ben@...> wrote:
>>> Does anyone know how INKEY with such negative values actually works?
>>Osbyte0 returns what type of host hardware you're running on. INKEY-256
>>(Osbyte 129,&FF00) returns the varient of the hardware, viz:
><List snipped>
>Thanks for that. An almost complete list, well done. Does INKEY with
>other negative values return anything?
OSBYTE 129 (Called by Basic's INKEY)
Entry: time Exit: result
(In Basic: result=INKEY time)
IF time >= 0 AND time <= &7FFF { 0 to 32767 } THEN
waits for a maximum of time centiseconds for a character from the
current input stream returns the next character, or -1 (&FFFF) if no
character returned in the passed time limit.
IF time < 0 AND time >= &FF80 { -1 to -128 } THEN
scan and return state of specified key, see table, returns -1 (&FFFF) if
key pressed, 0 (&0000) otherwise.
IF time < &FF80 AND time >= &FF01 { -129 TO -255 } THEN
scan range of keys starting at key (time EOF &7F) and return internal
key number in low byte of first pressed key found, or &FF in low byte
if no key pressed. High byte of returned value should be ignored.
IF time = &FF00 { -256 } THEN
returns a value relating to the variant of the host system being run on
in the low byte. The high byte of the returned value should be
ignored.
IF time < &FF00 { -256 } THEN
call is undefined, undefined value returned.
Internal Key Numbers
x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xA xB xC xD xE xF
&0x Alt lSh lCt lAt rSh rCt rAl mL mM mR
&0x SHIFT CTRL l8 l7 l6 l5 l4 l3 l2 l1 jF2 jF1 jL jR jD jU
&1x Q 3 4 5 f4 8 f7 - ^ left k6 k7 f11 f12 f10 ScLk
&2x f0 W E T 7 I 9 0 _ down k8 k9 Break ~ ` BS
&3x 1 2 D R 6 U O P [ up k+ k- kRet Ins Home PgUp
&4x Caps A X F Y J K @ : Ret k/ kDel k. NmLk PgDn "
&5x ShLk S C G H N L ; ] Del k# k* k,
&6x Tab Z Spc V B M , . / Copy k0 k1 k3
&7x Esc f1 f2 f3 f5 f6 f8 f9 \ right k4 k5 k2
Notes:
left,right,down,up -> cursor keys
kx -> keypad keys
lx -> keyboard links on BBC keyboard
lSh,lCt,lAt -> left Shift,Ctrl,Alt keys on Arc/RiscOS
rSh,rCt,rAt -> right Shift,Ctrl,Alt keys on Arc/RiscOS
mx -> mouse buttons
jx -> joystick buttons (rarely implemented)
Break -> soft Break key on Arc/RiscOS, not the hardware BREAK/RESET key
Negative INKEY numbers formed by EORing with &FF, so the SHIFT is INKEY-1.
--
J.G.Harston (JGH BBC PD Library) 70 Camm Street, Walkley, SHEFFIELD S6 3TR
jgh@... - Running on BBCs & Masters with SJ MDFS FileServer
Z80+6502/CoPro+Tubes/Econet+SJ - - - http://www.mdfsnet.f9.co.uk/User/JGH/
Et In Arcadia Ego