<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Thu, 04 Jan 2001 13:43:25 +0000 (GMT)
From   : Steve Fewell <kranser@...>
Subject: Re: BBCBasic

Ben Newsam <ben@...> wrote:

> Does anyone know how INKEY with such negative values
actually works?

INKEY with negative values uses an OSBYTE call, the
meaning of the negative
values is as follows:

INKEY -1 to INKEY -127 ==> returns TRUE if the
internal key number is pressed.

INKEY -128 ==> ALways returns FALSE (?).
INKEY -129 ==> returns TRUE if no internal keys with
numbers -3 to -127 are pressed.
INKEY -130 ==> returns TRUE if no internal keys with
numbers -3 to -127 are pressed.
INKEY -131 ==> returns TRUE if no internal keys with
numbers -3 to -127 are pressed.
INKEY -132 ==> returns TRUE if no internal keys with
numbers -4 to -127 are pressed.
INKEY -133 ==> returns TRUE if no internal keys with
numbers -5 to -127 are pressed.
...
INKEY -170 ==> returns TRUE if no internal keys with
numbers -42 to -127 are pressed.
...
INKEY -200 ==> returns TRUE if no internal keys with
numbers -72 to -127 are pressed.
...
INKEY -242 ==> returns TRUE if no internal keys with
numbers -114 to -127 are pressed.
     (that is (on a Master) keys: F1, F2, F3, F5, F6,
F8, F9, \ or |, CUR RIGHT, KPAD 4, KPAD 5 or KPAD 2)
...
INKEY -252 ==> returns TRUE if no internal keys with
numbers -124 to -127 are pressed.
INKEY -253 ==> returns TRUE if no internal keys with
numbers -125 to -127 are pressed.
INKEY -254 ==> returns TRUE if no internal keys with
numbers -126 to -127 are pressed.
INKEY -255 ==> returns TRUE if no internal keys with
numbers -127 to -127 are pressed.
and, of course, INKEY -256 which returns the Computer
code.

Useful commands are:
REPEAT UNTIL INKEY-130=0 OR INKEY -1 OR INKEY -2
  to wait until any key on the keyboard is pressed

REPEAT UNTIL INKEY-130 AND INKEY-1=0 AND INKEY -2=0
  to wait until no keys on the keyboard are pressed

Note that SHIFT (-1) and CTRL (-2) need to be tested
separately as, for some
reason, they are not tested for in INKEY-130.

INKEY -131 through to INKEY -255 is not particularly
useful; well, I can't think
of any use for it!

This is a listing of all internal key numbers that I
know of (based only on
the BBCB, BBC MASTER and Acorn Archimedies computers)
INKEY  COMPUTER   KEY
-1        ALL     SHIFT
-2        ALL     CTRL
-3        ALL     UNASSIGNED
-4        ALL     UNASSIGNED
-5        ALL     UNASSIGNED
-6        Arc     ALT (LEFT SPACE BAR)
-7        ALL     UNASSIGNED
-8        ALL     UNASSIGNED
-9        Arc     ALT (RIGHT SPACE BAR)
-10       Arc     LEFT MOUSE KEY
-11       Arc     MIDDLE MOUSE KEY
-12       Arc     RIGHT MOUSE KEY
-13       ALL     UNASSIGNED
-14       ALL     UNASSIGNED
-15       ALL     UNASSIGNED
-16       ALL     UNASSIGNED
-17       ALL     Q
-18       ALL     3 or #
-19       ALL     4 or $
-20       ALL     5 or %
-21       ALL     F4
-22       ALL     8 or (
-23       ALL     F7
-24       ALL     - or
-25       ALL     ^ or ~
-26       ALL     CURSOR LEFT
-27       MAS     KEYPAD 6
-28       MAS     KEYPAD 7
-29       Arc     F11
-30       Arc     F12
-31       ALL     UNASSIGNED
-32       Arc     SCROLL LOCK
-33       ALL     F0 [PRINT on Arc]
-34       ALL     W
-35       ALL     E
-36       ALL     T
-37       ALL     7 or '
-38       ALL     I
-39       ALL     9 or )
-40       ALL     0
-41       ALL     _ or œ
-42       ALL     CURSOR DOWN
-43       MAS     KEYPAD 8
-44       MAS     KEYPAD 9
-45       Arc     Break (if disabled via *FX229,1)
-46       Arc     ~ or `
-47       Arc     Ï or œ
-48       Arc     Back
-49       ALL     1 or !
-50       ALL     2 or "
-51       ALL     D
-52       ALL     R
-53       ALL     6 or &
-54       ALL     U
-55       ALL     O
-56       ALL     P
-57       ALL     { or [
-58       ALL     CURSOR UP
-59       MAS     KEYPAD +
-60       MAS     KEYPAD -
-61       MAS     KEYPAD RETURN
-62       Arc     Insert
-63       Arc     Home
-64       Arc     Page Up
-65       ALL     CAPS LOCK
-66       ALL     A
-67       ALL     X
-68       ALL     F
-69       ALL     Y
-70       ALL     J
-71       ALL     K
-72       ALL     @
-73       ALL     : or *
-74       ALL     RETURN
-75       MAS     KEYPAD /
-76       MAS     KEYPAD DELETE
-77       MAS     KEYPAD .
-78       Arc     Num Lock
-79       Arc     Page Down
-80       ALL     UNASSIGNED
-81       ALL     SHIFT LOCK
-82       ALL     S
-83       ALL     C
-84       ALL     G
-85       ALL     H
-86       ALL     N
-87       ALL     L
-88       ALL     ; or +
-89       ALL     } or ]
-90       ALL     DELETE
-91       MAS     KEYPAD #
-92       MAS     KEYPAD *
-93       MAS     KEYPAD ,
-94       ALL     UNASSIGNED
-95       ALL     UNASSIGNED
-96       ALL     UNASSIGNED
-97       ALL     TAB
-98       ALL     Z
-99       ALL     SPACE
-100      ALL     V
-101      ALL     B
-102      ALL     M
-103      ALL     , or <
-104      ALL     . or >
-105      ALL     / or ?
-106      ALL     COPY
-107      MAS     KEYPAD 0
-108      MAS     KEYPAD 1
-109      MAS     KEYPAD 3
-110      ALL     UNASSIGNED
-111      ALL     UNASSIGNED
-112      ALL     UNASSIGNED
-113      ALL     ESCAPE (if disabled via *FX229, 1)
-114      ALL     F1
-115      ALL     F2
-116      ALL     F3
-117      ALL     F5
-118      ALL     F6
-119      ALL     F8
-120      ALL     F9
-121      ALL     | or \
-122      ALL     CURSOR RIGHT
-123      MAS     KEYPAD 4
-124      MAS     KEYPAD 5
-125      MAS     KEYPAD 2
-126      ALL     UNASSIGNED
-127      ALL     UNASSIGNED

Also, some of these interal key codings can be
obtained by pressing a
combination of keys. For instance pressing CTRL (-2)
and F1 (-114)
and F6 (-118) together triggers the internal key code
-6. Does anyone know
how this works?

Regards,
Steve.



____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>