You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rust: Port libobs/obs-hotkey-name-map.c to obs-hotkey #833
claimedAn agent or person has claimed this; check the claim comment before startingenhancementNew feature or requestportPort a C unit to Rust (four-tier policy)
libobs/obs-hotkey-name-map.c (134 lines) to a new obs-hotkey crate: the exported obs_key_to_name and obs_key_from_name (obs-hotkey.h), and the internal obs_hotkey_name_map_free (obs-internal.h, called on shutdown).
Phase and position
Phase 6, tracker #444: the hotkey name map, listed there as separately claimable after obs-data.c (#784) and obs-properties.c (#828).
Dependencies and existing tests
No unit test covers the file directly; test_portal_shortcuts and test_x11_hotkey_layout call both functions incidentally. A characterization test test/cmocka/test_hotkey_name_map.c lands first, C only: every key in obs-hotkeys.h round-trips name → key → name, unknown and OBS_KEY_LAST_VALUE+ codes, OBS_KEY_NONE, case sensitivity, before and after obs_startup.
Notes
The C keeps a uthash map in obs->hotkeys built once with pthread_once, falling back to a linear scan when obs is NULL. Both give the same answer (first key with that name), so the port uses its own lazily built map and leaves the obs->hotkeys.name_map field unused; obs-internal.h is not edited. obs_hotkey_name_map_free becomes a hidden no-op export.
The name table is generated at build time from obs-hotkeys.h (608 entries), so it cannot drift from the C list.
Expected intentional differences, both where C has undefined behavior: a NULL name returns OBS_KEY_NONE (C's fallback calls strcmp(NULL) when obs is NULL), and a negative key logs and returns "" like an out-of-range one (C indexes before the array).
Correction to the issue text: the key table has 636 entries, not 608. The OBS_MOUSE_BUTTON(x) keys in obs-hotkeys.h expand to OBS_HOTKEY(x) in this file and are part of the list.
Done: #834 characterized obs-hotkey-name-map.c (C only) and #835 ported it to the obs-hotkey crate (Tier 1 1:1; Tier 3 against the original in both C modes, no core and with the name map; Tier 2 247/247 OFF and ON; ENABLE_RUST_LIBOBS=ON drops the C file). obs_hotkey_name_map_free is a hidden no-op; the obs->hotkeys.name_map field stays in obs-internal.h, unused.
Intentional differences (C has undefined behavior there): a null name returns OBS_KEY_NONE; a negative code logs and returns "".
claimedAn agent or person has claimed this; check the claim comment before startingenhancementNew feature or requestportPort a C unit to Rust (four-tier policy)
Activity
zackees commentedon Oct 15, 2026
Claiming: libobs/obs-hotkey-name-map.c
test/cmocka/test_hotkey_name_map.c.obs-hotkeycrate,todo!()core, Tier 1 1:1 port, Tier 3 parity for every key code and name against the C oracle.ENABLE_RUST_LIBOBS=ONdrops the C file.First PR today.
zackees commentedon Oct 15, 2026
Correction to the issue text: the key table has 636 entries, not 608. The
OBS_MOUSE_BUTTON(x)keys inobs-hotkeys.hexpand toOBS_HOTKEY(x)in this file and are part of the list.test: Characterize obs-hotkey-name-map.c before port (obs-rust#834)
obs-hotkey: Test the hotkey name map port against todo!() stubs (RED)
obs-hotkey: Port libobs/obs-hotkey-name-map.c (GREEN)
obs-c-oracle: Build obs-hotkey-name-map.c without -Wsign-conversion o…
zackees commentedon Oct 15, 2026
Done: #834 characterized
obs-hotkey-name-map.c(C only) and #835 ported it to theobs-hotkeycrate (Tier 1 1:1; Tier 3 against the original in both C modes, no core and with the name map; Tier 2 247/247 OFF and ON;ENABLE_RUST_LIBOBS=ONdrops the C file).obs_hotkey_name_map_freeis a hidden no-op; theobs->hotkeys.name_mapfield stays inobs-internal.h, unused.Intentional differences (C has undefined behavior there): a null name returns
OBS_KEY_NONE; a negative code logs and returns"".Nothing left on this unit.
obs-hotkey: Port libobs/obs-hotkey-name-map.c (obs-rust#835)