Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Flipper 6.0 Help File - <b>scan_conv()</b> c_demo http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SCAN_CONV()                                                         C_DEMO
   Converts key numbers to scan codes for use with CAD_SETUP().

   Syntax
      nValue = SCAN_CONV(nKeyNum)

   Arguments
      nKeyNum     Key number value to shift to high byte.

   Returns
      nValue      Converted number value.

   Description
      Whenever a key is pressed, a 16-bit code called a scan code that
      represents the keystroke is generated. The 16-bit code holds the ASCII
      value of the keystroke in the lower byte (the lower eight bits) and the
      scan code value in the upper byte (the upper eight bits). Special keys,
      such as the arrow keys, have a 0 in their lower byte (ASCII value).
      So, in order to use the special keys for CAD_SETUP(), their key numbers
      must be converted to the proper scan code by SCAN_CONV() for nKeyNum
      because they don't have an ACSII value.
                 +-----------------------------------------+
                 |Useful Keyboard Scan Codes               |
                 ------------------------------------------|
                 |   Key    |Scan Code|   Key    |Scan Code|
                 |----------+---------+----------+---------|
                 |    F1    |    59   |keypad "9"|    73   |
                 |    F2    |    60   |keypad "-"|    74   |
                 |    F3    |    61   |keypad "4"|    75   |
                 |    F4    |    62   |keypad "5"|    76   |
                 |    F5    |    63   |keypad "6"|    77   |
                 |    F6    |    64   |keypad "+"|    78   |
                 |    F7    |    65   |keypad "1"|    79   |
                 |    F8    |    66   |keypad "2"|    80   |
                 |    F9    |    67   |keypad "3"|    81   |
                 |    F10   |    68   |keypad "0"|    82   |
                 |keypad "7"|    71   |keypad "."|    83   |
                 |keypad "8"|    72   |          |         |
                 +-----------------------------------------+

   Examples

         CAD_SETUP(13,SCAN_CONV(80))      && Set the SnapKey to down arrow

See Also: CAD_SETUP()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson