- # Use backend capability name and a single argument
- items[ variant ][ sequence ][ combo ] = tuple(
- [ backend.capabilityLookup( items[ variant ][ sequence ][ combo ][0] ),
- tuple( [ hid_lookup_dictionary[ items[ variant ][ sequence ][ combo ] ] ] ) ]
- )
+ try:
+ # Use backend capability name and a single argument
+ items[ variant ][ sequence ][ combo ] = tuple(
+ [ backend.capabilityLookup( items[ variant ][ sequence ][ combo ][0] ),
+ tuple( [ hid_lookup_dictionary[ items[ variant ][ sequence ][ combo ] ] ] ) ]
+ )
+ except KeyError:
+ print ( "{0} {1} is an invalid HID lookup value".format( ERROR, items[ variant ][ sequence ][ combo ] ) )
+ sys.exit( 1 )