Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libobs/build/libobs.core+.h.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "libobs/obs-hotkey-enum-fields.c.h"
#include "libobs/obs-hotkey-identity-fields.c.h"
#include "libobs/obs-hotkey-identity-setter-fields.c.h"
#include "libobs/obs-hotkey-inject-entry.c.h"
#include "libobs/obs-hotkey-inject-entry-fields.c.h"
#include "libobs/obs-hotkey-object-fields.c.h"
#include "libobs/obs-hotkey-owned-translations-fields.c.h"
#include "libobs/obs-hotkey-pair-meta-setter-calls.c.h"
Expand Down
4 changes: 4 additions & 0 deletions libobs/build/libobs.ported-hotkey-inject-entry+.h.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* C reference for the Rust hotkey event injection wrapper. */
#include "libobs/build/libobs.pch.h"

#include "libobs/obs-hotkey-inject-entry.c.h"
5 changes: 5 additions & 0 deletions libobs/build/ported-source-sets/hotkey-inject-entry.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"LIBOBS_PORTED_SOURCES": [
"build/libobs.ported-hotkey-inject-entry+.h.c"
]
}
1 change: 1 addition & 0 deletions libobs/cmake/rust-exports.d/obs-hotkey-inject_entry.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obs_hotkey_inject_event
1 change: 1 addition & 0 deletions libobs/cmake/rust-hidden.d/obs-hotkey-inject_entry.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
obs_hotkey_inject_entry_request
9 changes: 9 additions & 0 deletions libobs/obs-hotkey-inject-entry-fields.c.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "libobs/build/libobs.pch.h"

bool obs_hotkey_inject_entry_strict(const void *core);

bool obs_hotkey_inject_entry_strict(const void *core)
{
const struct obs_core *context = core;
return context->hotkeys.strict_modifiers;
}
1 change: 1 addition & 0 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ and compares their exported symbols. `OBS_LIBOBS_BACKEND=C` is temporary rollbac
| `libobs/obs-hotkey-background-enum.c.h` | `obs-hotkey::background_enum` | Public background shortcut enumeration under the hotkey mutex: a NULL callback returns before locking, an unavailable core returns without calls, the live list (count and entries) is read again before every callback, arguments are the exact combination, borrowed trigger and bound flag with the caller's data, a false return stops early, and every acquired lock is released once. The unchanged isolated C characterization stays; an actual-library lifecycle test reaches the exported symbol. Real-header shortcut layout, borrowed list-pointer check and differential parity over the original C. No intentional differences. |
| `libobs/obs-hotkey-background-error.c.h` | `obs-hotkey::background_error` | Mutex-protected owned error copies, preserving NULL on failed locking or missing errors and bmalloc/bfree ownership for empty or arbitrary byte strings. Unchanged portal characterization and real-header differential parity. No intentional differences. |
| `libobs/obs-hotkey-background-press.c.h` | `obs-hotkey::background_press` | Inverted disable bit stored under the existing hotkey seam lock; exact synchronous `hotkey_background_press_changed(bool enabled)` signal after unlock, once per transition. Preserves missing-core no-op, repeated-value silence, fixed 128-byte calldata and listener re-entry. Unchanged C characterization, safe-core mirrors and original-C differential state/payload/lock parity. No intentional differences. |
| `libobs/obs-hotkey-inject-entry.c.h` | `obs-hotkey::inject_entry` | Captures one injection event after the existing hotkey seam locks, forwards every binding in the existing C array walk, including false events, then unlocks. Preserves all modifier bits and one captured strict flag through callbacks and live registry mutation. Unchanged C recorder, safe mirrors, real-header layout and original-C differential parity. No intentional differences. |
| `libobs/obs-hotkey-background-query.c.h` | `obs-hotkey::background_query` | Swapped in hybrid libobs (#3969). The public combination query preserves the native short circuit, identifier lookup and release. Actual-library native fallback characterization, real-header combination layout, callback-based differential parity and isolated allocation accounting. No exclusions or intentional differences. |
| `libobs/obs-hotkey-background-trigger.c.h` | `obs-hotkey::background_trigger` | Owned background trigger retrieval under the existing hotkey mutex. Preserves exact combo/wake_data, callback-before-unlock, rejected-output cleanup and exact allocation transfer, including allocated empty and successful NULL results. Unchanged C characterization, safe-core assertions, real-header layouts and differential ownership/dispatch parity. No intentional differences. |
| `libobs/obs-hotkey-binding-getters.c.h` | `obs-hotkey::binding_getters` | Three public binding getters: exact stored combination, independent binding ID and pointer identity. No intentional differences. Null stored hotkeys are preserved; null binding inputs remain outside the C contract. Full real-header binding/combination layouts and differential parity, with actual-library C characterization. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -37,7 +37,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"includes": [
"libobs"
Expand All @@ -60,7 +61,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand Down Expand Up @@ -134,7 +134,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"unity_groups": {
"background-control": [
Expand All @@ -144,7 +145,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -30,7 +30,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"libraries": [
"OBS::libobs",
Expand All @@ -51,7 +52,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -30,7 +30,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"libraries": [
"OBS::libobs",
Expand All @@ -51,7 +52,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -30,7 +30,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"libraries": [
"OBS::libobs",
Expand All @@ -51,7 +52,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -36,7 +36,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"includes": [
"libobs"
Expand All @@ -49,7 +50,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-pair-meta.c.h",
Expand All @@ -31,7 +31,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"libraries": [
"OBS::libobs",
Expand All @@ -47,7 +48,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"schema": 1,
"targets": {
"test_hotkey_inject_entry": {
"sources": [
"test/cmocka/test_hotkey_inject_entry.c",
"test/cmocka/hotkey-inject-entry-link-support.c"
],
"definitions": [
"obs=inject_test_obs",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"libraries": [
"OBS::libobs",
"OBS::caption",
"Uthash::Uthash",
"OBS::native-test-cmocka",
{
"name": "OBS::w32-pthreads",
"requires": "OS_WINDOWS"
},
"libobs_rust-static"
]
}
},
"tests": {
"test_hotkey_inject_entry": {
"target": "test_hotkey_inject_entry",
"command": [
"${target}"
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -30,7 +30,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"libraries": [
"OBS::libobs",
Expand All @@ -46,7 +47,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -36,7 +36,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"includes": [
"libobs"
Expand All @@ -49,7 +50,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"libobs/obs-hotkey-unregister.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -36,7 +36,8 @@
"obs_hotkeys_configure_background=obs_hotkey_background_control_configure_request",
"obs_hotkeys_set_background_probe=obs_hotkey_background_control_probe_request",
"obs_hotkey_combination_get_background_trigger=obs_hotkey_background_trigger_request",
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request"
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"includes": [
"libobs"
Expand All @@ -49,7 +50,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"libobs/obs-hotkey-background-control-fields.c.h",
"libobs/obs-hotkey.c.h",
"libobs/obs-hotkey-unregister-entry.c.h",
"libobs/obs-hotkey-inject-entry.c.h",
"libobs/obs-hotkey-inject-entry-fields.c.h",
"libobs/obs-hotkey-identity-setters.c.h",
"libobs/obs-hotkey-background-enum.c.h",
"libobs/obs-hotkey-enum.c.h",
Expand All @@ -32,7 +32,8 @@
"obs_hotkey_enable_background_press=obs_hotkey_background_press_request",
"pthread_mutex_lock=unregister_entry_mutex_lock",
"pthread_mutex_unlock=unregister_entry_mutex_unlock",
"obs_hotkey_unregister_one=unregister_entry_remove_one"
"obs_hotkey_unregister_one=unregister_entry_remove_one",
"obs_hotkey_inject_event=obs_hotkey_inject_entry_request"
],
"libraries": [
"OBS::libobs",
Expand All @@ -48,7 +49,7 @@
"libobs/obs-hotkey-identity-setters.c.h"
],
"hotkey_inject_entry": [
"libobs/obs-hotkey-inject-entry.c.h"
"libobs/obs-hotkey-inject-entry-fields.c.h"
],
"hotkey_registration": [
"libobs/obs-hotkey-register.c.h",
Expand Down
Loading
Loading