# Is there a way to tell listings what to do immediately after escaping?

What I want to do is having two or more possibilities when escaping from normal code formatting. For instance, if I give the option escapechar=\⠶ I would like to avoid saying something like this:

\begin{lstlistings}[language=C,escapechar=\⠶]
double a;
int i; ⠶\color{red}$\longleftarrow$ this is counter $i$⠶
\end{lstlistings}

I just want to escape with the given (unusual) character being sure that the color command is automatically given. In other words, the escaped text in the following code:

\begin{lstlistings}[language=C,escapechar=\⠶]
double a;
int i; ⠶$\longleftarrow$ this is counter $i$⠶
\end{lstlistings}

should be in red.

\begin{lstlistings}[language=C,escapechar=\£]
double a; £\color{green}$\longleftarrow$ this is the variable $a$£
int i;
\end{lstlistings}

I want to escape with the character £ being sure that a green text is typeset.

-
int i; ⠶$\longleftarrow$ this is counter $i$⠶