The following minimal working example shows the problem. The mainmacro is an example of what I need; here I want to use my keys and keys from tikz (like draw,color,shape). The result is fine only if I use `shape = circle`. `circle` is not enough. Idem if I want the color red. `color = red` is obligatory. What is wrong in my code ? Do you know a better way to achieve what I want ?

```
\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\makeatletter
\pgfkeys{/mykeys/.cd,
d/.code                     = {\def\macro@d{#1}},   
a/.code                     = {\def\macro@a{#1}},
/mykeys/.unknown/.code      = {\let\searchname=\pgfkeyscurrentname
                                               \pgfkeysalso{\searchname/.try=#1,
                                                    /tikz/\searchname/.retry=#1}
                              }    
        }  
\def\mainmacro{\pgfutil@ifnextchar[{\main@macro}{\main@macro[]}}
\def\main@macro[#1](#2)#3{%
\begingroup
  \pgfkeys{mykeys/.cd,
           d = 1,
           a = 45}
  \pgfqkeys{/mykeys}{#1}
  \path (#2) --+(\macro@a:\macro@d) node[/mykeys/.cd,#1] {#3};
\endgroup
}
\makeatother

\begin{document} 

    \begin{tikzpicture}
        \draw (0,0) --( 1,1) coordinate (a) ;
        \mainmacro[a=0,d=12pt,draw,shape=circle](a){label 1}    
        \mainmacro[d=2cm,draw,circle](a){label 2}       
    \end{tikzpicture}

\end{document}

```

[![enter image description here](https://i.stack.imgur.com/Gw7V1.png)](https://i.stack.imgur.com/Gw7V1.png)

Update

```
\documentclass[a4paper]{article}
\usepackage{tikz}
\usetikzlibrary{calc}

\makeatletter
\pgfkeys{/mykeys/.cd,
d/.store in                 = {\macro@d},   
a/.store in                 = {\macro@a},
/mykeys/.unknown/.code      = {\let\searchname=\pgfkeyscurrentname
                                               \pgfkeysalso{\searchname/.try=#1,
                                                    /tikz/\searchname/.retry=#1,
                                                    /tikz/.cd,#1}}}  

\def\mainmacro{\pgfutil@ifnextchar[{\main@macro}{\main@macro[]}}
\def\main@macro[#1](#2){%
\begingroup
\pgfkeys{mykeys/.cd,
           d = 1,
           a = 1}
\pgfqkeys{/mykeys}{#1}

\draw[/mykeys/.cd,#1] (\macro@a,\macro@a) circle (\macro@d) --++(1,1) node[#1] {label};% 
\endgroup
}
\makeatother

\begin{document} 
    \begin{tikzpicture}
        \draw (0,0) -- (5,0) ;
        \mainmacro[red,ultra thick](a)       
    \end{tikzpicture}

\end{document}

```

[![enter image description here](https://i.stack.imgur.com/44XLN.png)](https://i.stack.imgur.com/44XLN.png)

The trick works for the node but not with `\draw` perhaps I'm wrong somewhere in my code