(go to: table of contents, index, list of vms_smg, prev: GET_DISPLAY_ATTR, next: NEXT)
Format:
VMS_SMG_GET_KEYBOARD_ATTRIBUTES - Get Keyboard Attributes
Get information about a virtual keyboard and stores it in a Python dictionary.
keyboard_info_table = vms_smg.get_keyboard_attributes \
(keyboard_id)
Returns:
Arguments:
Examples:
(go to: table of contents,
index, list of vms_smg,
prev: GET_DISPLAY_ATTR,
next: NEXT)
>>> import vms_smg
>>> import vms_smgdef
>>> # create a new DECwindows terminal using SMG
>>> status, pasteboard_id, number_of_pasteboard_rows, \
... number_of_pasteboard_columns, type_of_terminal, \
... device_name = vms_smg.create_pasteboard \
... (None, vms_smgdef.SMG_M_WORKSTATION)
>>>
>>> # create a virtual keyboard -
>>> # use the device name from CREATE_PASTEBOARD
>>> keyboard_id, resultant_filespec = \
... vms_smg.create_virtual_keyboard (device_name)
>>>
>>> # get information about the virtual keyboard
>>> keyboard_info_table = vms_smg.get_keyboard_attributes \
... (keyboard_id)
>>>
>>> print type(keyboard_info_table)
<type 'dictionary'>
>>>
>>> # show contents of the dictionary returned
>>> for key_name in keyboard_info_table.keys():
... print ("%14s: %s") % \
... ( key_name, str(keyboard_info_table[key_name]) )
...
W_NUM_COLUMNS: 80 # 80 columns wide
L_DEV_DEPEND: 402690992 # = 0x180093B0 - specific char 1
L_DEV_DEPEND2: -70250496 # = 0xFBD01000 - specific char 2
B_DEVTYPE: 112 # physical device type (TT$_VT300_Series)
B_RECALL_NUM: 20 # size of recall buffer (byte)
W_TYPEAHD_CNT: 0 # number of character in typeahead buffer
L_DEV_CHAR: 0 # device characteristics
B_TYPEAHD_CHAR: 0 # first character in typeahead buffer
B_DEV_CLASS: 66 # DC$_TERM
>>>
(have entered 3 characters ('ttt') in the empty DECterm)
>>>
>>> # again, get information about the virtual keyboard
... keyboard_info_table = vms_smg.get_keyboard_attributes (keyboard_id)
>>>
>>> for key_name in keyboard_info_table.keys():
... print ("%14s: %s") % \
... ( key_name, str(keyboard_info_table[key_name]) )
...
W_NUM_COLUMNS: 80
L_DEV_DEPEND: 402690992
L_DEV_DEPEND2: -70250496
B_DEVTYPE: 112
B_RECALL_NUM: 20
W_TYPEAHD_CNT: 3 # 3 characters in the buffer
L_DEV_CHAR: 0
B_TYPEAHD_CHAR: 116 # first character, see below
B_DEV_CLASS: 66
>>>
>>> print chr(keyboard_info_table['B_TYPEAHD_CHAR'])
t
>>>