Scan codes 
Author Message
 Scan codes

Alright, ev'vy one knows how to use the arrow keys.

ch:=readkey
 if ch=#0 then begin
 ch:=readkey
  case ch of
   77:{up};
  {etc.etc.etc.}
  end;{case}
 end;{if}

Now, for a *2* player game, you can only use one key at a time. How do
you use scan codes?

I would prefer to get the algorithms, rather than someone elses unit.

Thanx.


"An it harm none, do as ye will."
     - Wiccan Credo -

http://www.*-*-*.com/ ~hayden/geek.html
-----BEGIN GEEK CODE-----
version 3.12
GCS d-(+) s+:+ a--- C+>++ W++>+++ N+ O? K? w+ M+(--) PS+ PE- Y+
PGP- t+ 5? X-- tv b+++ DI++ D+ G>+++ e>++++ h! r->+++ y+>+++
------END GEEK CODE------



Thu, 29 Apr 1999 03:00:00 GMT  
 Scan codes

If i'm not mistaken you can get scan codes from port[$60]
if port[$60] < $80 then it means that a key is being pressed. If
port[$60]>$7f then it means that a key has been pressed.

To find out what key has been pressed, use the table below.

If you're planning to make a 2 player game, you can even use
each shift key seperately i.e left shift something and right
shift something else.

Hope it helps.

     Key       Code         Key          Code         Key          Code

     Esc       1            A            30           Caps Lock    58
     ! or 1    2            S            31           F1           59

     # or 3    4            F            33           F3           61
     $ or 4    5            G            34           F4           62
     % or 5    6            H            35           F5           63
     ^ or 6    7            J            36           F6           64
     & or 7    8            K            37           F7           65
     * or 8    9            L            38           F8           66
     ( or 9    10           : or ;       39           F9           67
     ) or 0    11           " or '       40           F10          68
     _ or -    12           ~ or `       41           F11          133
     + or =    13           Left Shift   42           F12          134
     Bksp      14           | or \       43           NumLock      69
     Tab       15           Z            44           Scroll Lock  70
     Q         16           X            45           Home or 7    71
     W         17           C            46           Up or 8      72
     E         18           V            47           PgUp or 9    73
     R         19           B            48           Gray -       74
     T         20           N            49           Left or 4    75
     Y         21           M            50           Center or 5  76
     U         22           < or ,       51           Right or 6   77
     I         23           > or .       52           Gray +       78
     O         24           ? or /       53           End or 1     79
     P         25           Right Shift  54           Down or 2    80
     { or [    26           Prt Sc or *  55           PgDn or 3    81
     } or ]    27           Alt          56           Ins or 0     82
     Enter     28           Spacebar     57           Del or .     83
     Ctrl      29                                

       /_//_//_/    /_//_//_/      /_//_//_/      /_/
    /_/       /_/  /_/     /_/    /_/     /_/    /_/
   /_/       /_/  /_/       /_/  /_/       /_/  /_/
  /_/       /_/  /_/       /_/  /_/       /_/  /_/
 /_/       /_/  /_/       /_/  /_/       /_/  /_/
/_/       /_/  /_/      /_/   /_/      /_/  
 /_//_//_/    /_//_//_/      /_//_//_/      /_/

                        \\|//

 / ^ \                                          \

 \ _ /__________________________________________/  

            " To add spice to your life "

     HOW TO SUBSCRIBE:

     with the SUBJECT.  SUBSCRIBE ODD

    +-=-=- My Miscellaneous Home Page =-=-=-+
    |  http://www.geocities.com/Area51/9333 |
    +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

  This list is operated on a when I like it basis.
  It will include humour, proverbs and other neat
  stuff. I will try to keep it on a daily basis.

=-=-=-=-=-=-=-=-= COPYRIGHT NOTICE =-=-=-=-=-=-=-=-=
All materials presented are owned by their authors.
They have been sourced from different areas.

=-=-=-=-=-=-=- FREE GIFT SUBSCRIPTION -=-=-=-=-=-=-=
You can subscribe a friend ( with their permission )
by sending mail with subject   SUBSCRIBE ODD FRIEND
and typing their e-mail address in the body.
_                                             _  _
 | Admin,             ooO   Ooo              | || |  
 | Shawn Tan.        (   ) (   )          _ _| || |
 |====                \ (   ) /          | | | __ |
 / ^ \_                \_) (_/           |_|_||__ \

 \ _ /                                     \_____/



Fri, 30 Apr 1999 03:00:00 GMT  
 Scan codes

How do you use port[$60], because I checked Help for port, and I couldn't
find it.

Quote:
> If i'm not mistaken you can get scan codes from port[$60]
> if port[$60] < $80 then it means that a key is being pressed. If
> port[$60]>$7f then it means that a key has been pressed.

> To find out what key has been pressed, use the table below.

> If you're planning to make a 2 player game, you can even use
> each shift key seperately i.e left shift something and right
> shift something else.

> Hope it helps.

>      Key       Code         Key          Code         Key          Code

>      Esc       1            A            30           Caps Lock    58
>      ! or 1    2            S            31           F1           59

>      # or 3    4            F            33           F3           61
>      $ or 4    5            G            34           F4           62
>      % or 5    6            H            35           F5           63
>      ^ or 6    7            J            36           F6           64
>      & or 7    8            K            37           F7           65
>      * or 8    9            L            38           F8           66
>      ( or 9    10           : or ;       39           F9           67
>      ) or 0    11           " or '       40           F10          68
>      _ or -    12           ~ or `       41           F11          133
>      + or =    13           Left Shift   42           F12          134
>      Bksp      14           | or \       43           NumLock      69
>      Tab       15           Z            44           Scroll Lock  70
>      Q         16           X            45           Home or 7    71
>      W         17           C            46           Up or 8      72
>      E         18           V            47           PgUp or 9    73
>      R         19           B            48           Gray -       74
>      T         20           N            49           Left or 4    75
>      Y         21           M            50           Center or 5  76
>      U         22           < or ,       51           Right or 6   77
>      I         23           > or .       52           Gray +       78
>      O         24           ? or /       53           End or 1     79
>      P         25           Right Shift  54           Down or 2    80
>      { or [    26           Prt Sc or *  55           PgDn or 3    81
>      } or ]    27           Alt          56           Ins or 0     82
>      Enter     28           Spacebar     57           Del or .     83
>      Ctrl      29                                

>        /_//_//_/    /_//_//_/      /_//_//_/      /_/
>     /_/       /_/  /_/     /_/    /_/     /_/    /_/
>    /_/       /_/  /_/       /_/  /_/       /_/  /_/
>   /_/       /_/  /_/       /_/  /_/       /_/  /_/
>  /_/       /_/  /_/       /_/  /_/       /_/  /_/
> /_/       /_/  /_/      /_/   /_/      /_/  
>  /_//_//_/    /_//_//_/      /_//_//_/      /_/

>                    \\|//

>  / ^ \                                          \

>  \ _ /__________________________________________/  

>        " To add spice to your life "

>      HOW TO SUBSCRIBE:

>      with the SUBJECT.  SUBSCRIBE ODD

>     +-=-=- My Miscellaneous Home Page =-=-=-+
>     |  http://www.geocities.com/Area51/9333 |
>     +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+

>   This list is operated on a when I like it basis.
>   It will include humour, proverbs and other neat
>   stuff. I will try to keep it on a daily basis.

> =-=-=-=-=-=-=-=-= COPYRIGHT NOTICE =-=-=-=-=-=-=-=-=
> All materials presented are owned by their authors.
> They have been sourced from different areas.

> =-=-=-=-=-=-=- FREE GIFT SUBSCRIPTION -=-=-=-=-=-=-=
> You can subscribe a friend ( with their permission )
> by sending mail with subject   SUBSCRIBE ODD FRIEND
> and typing their e-mail address in the body.
> _                                             _  _
>  | Admin,             ooO   Ooo              | || |  
>  | Shawn Tan.        (   ) (   )          _ _| || |
>  |====                \ (   ) /          | | | __ |
>  / ^ \_                \_) (_/           |_|_||__ \

>  \ _ /                                     \_____/

*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<*
{    /^\    ****    /^\                                      }
{   |   |**/____\**|   |                                     }
{  /                    \   In a world of constant change    }
{ |   (-)         (-)    |  Only one thing remains the same; }
{  \__                __/   Fortunately, it's not the fox.   }
{  ----\-*        *-/----                                    }

{          \____/                                            }
{            **                      F O X M A N             }
*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*


Sun, 02 May 1999 03:00:00 GMT  
 Scan codes

In article <Pine.SOL.3.91.961113151329.25678C-

Quote:


>How do you use port[$60], because I checked Help for port, and I couldn't
>find it.

>> If i'm not mistaken you can get scan codes from port[$60]
>> if port[$60] < $80 then it means that a key is being pressed. If
>...
>>      Ctrl      29                                

>>        /_//_//_/    /_//_//_/      /_//_//_/      /_/
>>     /_/
>>    /_/
>>   /_/  
>>  /_/
>> /_/
>>  /_/

>>                      \\|//
>>      ___
>>  /
>> |
>>  \

>>          "

>>      H
>>      S
>>      w

>>     +
>>     |
>>     +

>>   T
>>   I
>>   s

>> =
>> A
>> T

>> =
>> Y
>> b
>> a
>> _  
>>  | Admin,    
>>  | Shawn Tan.
>>  |=
>>  /
>> |
>>  \

>*>>>
>{  
>{  
>{  
>{
>{  
>{  

>{            **                      F O X M A N             }
>*<<<

Sigs narrowed.

Remember that other users PAY for connect time and storage.

Trim your signatures, gentlemen, or else you may get copies of Son-of-
RFC1036 E-mailed to you from all & sundry.  Here's a relevant part :

 Early  difficulties in inferring return addresses from arti-
 cle headers led to "signatures": short closing texts,  auto-
 matically  added  to  the end of articles by posting agents,
 identifying the poster and giving his network addresses etc.
 If  a  poster or posting agent does append a signature to an
 article, the signature SHOULD be preceded with  a  delimiter
 line  containing  (only)  two hyphens (ASCII 45) followed by
 one blank (ASCII  32).   Posting  agents  SHOULD  limit  the
 length  of  signatures,  since  verbose  excess bordering on
 abuse is common if no restraint is imposed;  4  lines  is  a
 common limit.

--

    http://www.merlyn.demon.co.uk/



Tue, 04 May 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Scan Code Conversion

2. Q: Keyboard Scan Codes as Hex.

3. Scan Code Conversion

4. How do I read extended scan codes?

5. help on keyboard scan codes

6. XT Scan Codes?

7. scan codes

8. Keyboard Scan Code Help needed!

9. Help on keyboard scan-code problem

10. Where do I get ASCII and scan codes for the different keys?

11. Scan a Form

12. Provide Data Entry, OCR & Scanning Services

 

 
Powered by phpBB® Forum Software