Use the following to retrieve the key code for a given key name.
--- Get key code for a given key namelocal key_name ='enter'--- Utils objectlocal key_code = utils.keys.get_key(key_name)print('Key Code for', key_name, ':', key_code)--- Direct exportlocal key_code = exports.boii_utils:get_key(key_name)
get_key_name
Use the following to retrieve the key name by a given key code.
--- Get key name for a given key codelocal key_code =191--- Utils objectlocal key_name = utils.keys.get_key_name(key_code)print('Key Name for code', key_code, ':', key_name)--- Direct exportlocal key_name = exports.boii_utils:get_key_name(key_code)
print_key_list
Use the following to print the current key list.
--- Utils objectutils.keys.print_key_list()--- Direct exportexports.boii_utils:print_key_list()
key_exists
Use the following to check if a key exists in the keys table by name.
--- Check if a key existslocal key_name ='escape'--- Utils objectlocal exists = utils.keys.key_exists(key_name)print('Does key exist?', key_name, ':', exists)--- Direct exportlocal exists = exports.boii_utils:key_exists(key_name)