It doesn't need to be this general as the issue is mostly about Windows. Also use the same modifier shuffle that RealVNC and TigerVNC uses to get macOS working well.