A squashed version of the original changeset from https://github.com/zmkfirmware/zmk/pull/778 rebased on main