Repository navigation
obs-hotkey: Port libobs/obs-hotkey-name-map.c - #835
Merged
Merged
Conversation
New obs-hotkey crate: obs_key_to_name and obs_key_from_name shims, and a hidden no-op obs_hotkey_name_map_free, over todo!() cores. The key table is generated from obs-hotkeys.h (636 entries, mouse buttons included). - Tier 1 (tests/hotkey_name_map.rs): 1:1 port of test_hotkey_name_map. - Tier 3 (tests/parity.rs): every code and name, random names and codes, against obs-hotkey-name-map.c compiled as oracle_*, both without a core (linear scan) and with one (the name map). - ENABLE_RUST_LIBOBS=ON drops obs-hotkey-name-map.c. Refs #833
One lazily built map from key name to the first key with that name serves both of C's paths (no core and after obs_startup), which give the same answers. obs_key_to_name logs the same error for unknown codes. The obs->hotkeys.name_map field stays in obs-internal.h, unused. Refs #833
zackees
force-pushed
the
port/hotkey-name-map-rust
branch
from
October 15, 2026 19:11
f4a5660 to
6520f6b
Compare
Member
Author
|
#834 merged; rebased onto master: replaced head |
zackees
marked this pull request as ready for review
October 15, 2026 19:11
…n clang obs_key_from_name returns an int as obs_key_t, which clang treats as unsigned; the oracle's -Wsign-conversion failed the macOS and cross builds. libobs itself does not use the flag. Refs #833
Member
Author
|
Cross Lint and macOS Rust Tests failed: clang's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #833.
RED (
obs-hotkey: Test the hotkey name map port against todo!() stubs): newobs-hotkeycrate withobs_key_to_name/obs_key_from_nameshims and a hidden no-opobs_hotkey_name_map_free(rust-hidden.txt,rust-exports.map,rust-unexports-macos.txt), overtodo!()cores. Tier 1 aborts ontodo!("hotkey name map port (#833)")intest_without_core.tests/hotkey_name_map.rs: 1:1 port oftest_hotkey_name_map(test: Characterize obs-hotkey-name-map.c before port #834).ENABLE_RUST_LIBOBS=ONdropsobs-hotkey-name-map.c.tests/parity.rs: every code 0..2000 and every name, plus random names and codes, against the original compiled asoracle_*, both without a core (C's linear scan) and with a zeroed one (C's name map), so both C paths are compared.The key table is generated at build time from
obs-hotkeys.h: 636 entries,OBS_MOUSE_BUTTONkeys included.GREEN (
obs-hotkey: Port libobs/obs-hotkey-name-map.c): one lazily built map from name to the first key with that name serves both of C's paths, which give the same answers.obs_key_to_namelogs C's error for unknown codes. Theobs->hotkeys.name_mapfield stays inobs-internal.h, unused.Intentional differences (where C has undefined behavior): a null name returns
OBS_KEY_NONE; a negative code logs and returns"".Local:
ci/local_gate.py --lane rust-testok.key_namefailsevery_key_matches.rust/tools/linux-validate/run.sh: 247/247 OFF and ON, hotkey callers repeated../lintok.A first Tier 2 run failed
test_vlc_playlist_gapin the ON build (an audio timestamp jump cut 1.9 s of a file under load); it passed on rerun and does not use key names.