mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 02:00:06 +02:00
remap_volume stopped at the first EVIOCSKEYCODE_V2 that failed, so the volume entries after it were never tried. On a keyboard where swapping volume up failed, volume down stayed a real key that gamescope reads, and one press with nothing focused aborts gamescope and the VR session. Restoring had the same hole: a failed entry left the later stand-ins in place after the relay exited. Now every entry is tried and the first failure is raised at the end. take_volume already marks the device remapped on that error, so the relay routes the stand-ins that did swap and restores them on exit. Checked against a fake keymap with a stubbed fcntl.ioctl: with volume up's swap failing, volume down now swaps (it stayed real before), the same for restore, and full swaps, restores and the no-keymap case come out as before. Found by 0x1f6 in PR #8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>