The UI currently prevents settings Mouse1 or Mouse2 or hotkeys, however if someone modifies their scene collection json to add these hotkeys, OBS will still load them and cause all sorts of weird behaviour.
The frontend prevents setting these as hotkeys, and libobs should similarly avoid loading them.
|
static inline void load_binding(obs_hotkey_t *hotkey, obs_data_t *data) |
|
{ |
|
if (!hotkey || !data) |
|
return; |
|
|
|
obs_key_combination_t combo = {0}; |
|
uint32_t *modifiers = &combo.modifiers; |
|
load_modifier(modifiers, data, "shift", INTERACT_SHIFT_KEY); |
|
load_modifier(modifiers, data, "control", INTERACT_CONTROL_KEY); |
|
load_modifier(modifiers, data, "alt", INTERACT_ALT_KEY); |
|
load_modifier(modifiers, data, "command", INTERACT_COMMAND_KEY); |
|
|
|
combo.key = obs_key_from_name(obs_data_get_string(data, "key")); |
|
if (!modifiers && (combo.key == OBS_KEY_NONE || combo.key >= OBS_KEY_LAST_VALUE)) |
|
return; |
|
|
|
create_binding(hotkey, combo); |
|
} |
I think we would likely do so here, but it would good for someone to thoroughly investigate this and ensure it's the correct place to do so.
The UI currently prevents settings Mouse1 or Mouse2 or hotkeys, however if someone modifies their scene collection json to add these hotkeys, OBS will still load them and cause all sorts of weird behaviour.
The frontend prevents setting these as hotkeys, and libobs should similarly avoid loading them.
obs-studio/libobs/obs-hotkey.c
Lines 469 to 486 in 25fbaf7
I think we would likely do so here, but it would good for someone to thoroughly investigate this and ensure it's the correct place to do so.