Keys can be set a default value by the handler /.default in pgfkeys. However, when this is used, the name of the key has to be in the list of \pgfkeys(e.g. \pgfkeys{mykey}).
My question is: how to make a key get a default value when this key is not in the list of \pgfkeys.
Here is my code example for illustration.
\documentclass{article}
\usepackage{pgfkeys}
\begin{document}
\pgfkeys{mykey/.code=#1}
\pgfkeys{} % I want to get a typeset of "3" for example
\end{document}
initialnotdefault) – TeXnician May 19 '18 at 09:58\pgfkeysdoes set the keys, but not invoke them/gets the value. You should read the manual. – TeXnician May 20 '18 at 07:01