Programming with Reflection

image\rwnprg32.gif SetScanCodeName method


Syntax object.SetScanCodeName ScanType, ScanCode, Key



Assigns a name to a key's scan code. This name can then be used to map the key (with SetKeyMap).

You only need to use SetScanCodeName if you're using a nonstandard keyboard—that is, a keyboard with different key names than a standard keyboard, or a keyboard whose keys generate scan codes that differ from those generated by a standard keyboard. If you have an IBM PC or XT keyboard, an IBM PC/AT keyboard, an IBM Enhanced 101/102 key keyboard, or a keyboard that matches the key layout of any of these keyboards, you shouldn't need to use SetScanCodeName.


ScanType Argument type: Enumeration
The type of scan code generated by the key. Use the KEYMON utility to determine scan codes and scan code types.

There are three possible values for this argument:


 An extended scan code is one that starts with E0. When you run KEYMON to determine your scan code, the first line of output (when you press a key) may look like this:

 Interrupt 9 scan code: E0h,224d

 If the first characters after the colon are E0, use rcExtended as your ScanType.


 Like rcExtended, except the scan code starts with E1 instead of E0.


 If the scan code does not start with E0 or E1, use rcNormal as your ScanType.

ScanCode Argument type: Integer
The decimal value of the scan code. When you run KEYMON and then press a key, it usually returns three lines of information about the key. For example, if you press the m key, this is KEYMON's response:

 Interrupt 9 scan code: 32h, 50d
Interrupt 16 returns: AH=32h, 60d AL=6Dh, 109d <m>
Interrupt 9 scan code: B2h,178d

 The number preceding the letter d on the first line (in this case, 50) is the decimal value of the scan code.

Key Argument type: String
Specifies a string that you create for the key name. One possible name is the name of the key in question, but Reflection accepts any alphanumeric string. This name can then be used with SetKeyMap (as the value for the KeyOrChord argument) to map this key.


image\jump.gif Keyword Index

image\popup.gif Related Topics

image\popup.gif Reflection products that use this command