\def\q@recursion@tail{\q@recursion@tail}
\protected\long\def\Xsetkeys#1#2#3{% #1 = NoArgFunc, #2 = ArgFunc, #3 = keyvals
\let\@tempc\@empty
\XKV@do#1#2#3,\q@recursion@tail,}
\protected\long\def\XKV@do#1#2#3,{% #1 = NoArgFunc, #2 = ArgFunc, #3 = keyval
\ifx\q@recursion@tail#3\@empty\else
\XKV@split#1#2#3==\relax
\expandafter\XKV@do\expandafter#1\expandafter#2\fi}
\protected\long\def\XKV@split#1#2#3=#4=#5\relax{%
\KV@@sp@def\@tempa{#3}%
\ifx\@tempa\@empty\else
\if\relax\detokenize{#5}\relax