-- Hotkey definitions and default settings
hk = {}
key_1 = '{ "htk_1": [ { "key": "OBS_KEY_F1" } ], ' -- HK to temp remove_overlays
key_2 = ' "htk_2": [ { "key": "OBS_KEY_F2" } ], ' -- HK to temp display_overlays (all of them)
key_3 = ' "htk_3": [ { "key": "OBS_KEY_F3" } ], ' -- HK to redisplay_overlays
key_4 = ' "htk_4": [ { "key": "OBS_KEY_F12" } ], ' -- HK to toggle_event_position
key_5 = ' "htk_5": [ { "key": "OBS_KEY_F9" } ], ' -- HK to toggle_event_type (synchro or individual)
key_6 = ' "htk_6": [ { "key": "OBS_KEY_F5" } ], ' -- HK to permanently remove overlays
key_7 = ' "htk_7": [ { "key": "OBS_KEY_F8" } ], ' -- HK to disable auto-hide of overlays
key_8 = ' "htk_8": [ { "key": "OBS_KEY_F10" } ], ' -- HK to toggle Event A or Event B
key_9 = ' "htk_9": [ { "key": "OBS_KEY_Ctrl+F12" } ] } ' -- HK to toggle simultaneous events mode
json_s = key_1 .. key_2 .. key_3 .. key_4 .. key_5 .. key_6 .. key_7 .. key_8 .. key_9
default_hotkeys =
{
{id='htk_1', des='Temporary Remove DR2TVOverlays ', callback=remove_overlays},
{id='htk_2', des='Temporary Display All DR2TVOverlays ', callback=display_overlays},
{id='htk_3', des='Re-display Overlays ', callback=redisplay_overlays},
{id='htk_4', des='Toggle Event Overlay Position ', callback=toggle_event_position},
{id='htk_5', des='Toggle Event Type (Synchro or Individual) ', callback=toggle_event_type},
{id='htk_6', des='Permanently Remove All Overlays ', callback=toggle_display_disable},
{id='htk_7', des='Disable Auto-hide of Overlays ', callback=toggle_disable_of_autohide},
{id='htk_8', des='Toggle to Display Event A or Event B ', callback=toggle_event_a_or_b},
{id='htk_9', des='Toggle to/from Simultanious Event Overlays ', callback=toggle_simultaneous_events},
}
-- The function named "script_load" will be called on startup
function script_load(settings)
s = obs.obs_data_create_from_json(json_s)
for _,v in pairs(default_hotkeys) do
a = obs.obs_data_get_array(s,v.id)
h = obs.obs_hotkey_register_frontend(v.id,v.des,v.callback)
obs.obs_hotkey_load(h,a)
obs.obs_data_array_release(a)
end
obs.obs_data_release(s)