(go to: table of contents, index, list of vms_smg, prev: MOVE_VIRTUAL_DISPLAY, next: PASTE_VIRTUAL_DISPLAY)
Format:
NAME_TO_KEYCODE - Translate a Key Name into a Key Code
Translate the key name of a key on the keyboard into its associated key code.
The opposite function is
vms_smg.keycode_to_name().
key_code = vms_smg.name_to_keycode (key_name)
Returns:
Arguments:
Examples:
(go to: table of contents,
index, list of vms_smg,
prev: MOVE_VIRTUAL_DISPLAY,
next: PASTE_VIRTUAL_DISPLAY)
>>> import vms_smg
>>> import vms_smgdef
>>> key_code = vms_smg.name_to_keycode ('PF2')
>>> print key_code, vms_smgdef.SMG_K_TRM_PF2
257 257
>>>
----------------------------------------
>>> print vms_smg.name_to_keycode ('*BAD*')
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_smg.error: (1213466, '%SMG-E-INVKEYNAM, invalid key name')
>>>
>>> print vms_smg.name_to_keycode (0)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: argument 1: expected read-only buffer, int found
>>>