This is my script:
obs = obslua
bit = require("bit")
hotkeys = {
htk_show = "Show Zoom Cap on Monitor 1",
htk_hide = "Hide Zoom Cap on Monitor 1",
}
hk = {}
function hotkey_mapping(hotkey)
if hotkey == "htk_show" then
obs.obs_frontend_open_projector("Scene", 2, 0, "Welkom")
elseif hotkey == "htk_hide" then
print('Hide')
end
end
function script_load(settings)
for k, v in pairs(hotkeys) do
hk[k] = obs.obs_hotkey_register_frontend(k, v, function(pressed)
if pressed then
hotkey_mapping(k)
end
end)
a = obs.obs_data_get_array(settings, k)
obs.obs_hotkey_load(hk[k], a)
obs.obs_data_array_release(a)
end
end
function script_save(settings)
for k, v in pairs(hotkeys) do
a = obs.obs_hotkey_save(hk[k])
obs.obs_data_set_array(settings, k, a)
obs.obs_data_array_release(a)
end
end