You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Mitch Claborn <mi...@claborn.net> on 2023/05/05 18:43:55 UTC

Context aware keymapping + macro

Is it possible to have a macro that is invoked via a key mapping to 
operate differently depending on the contexts in which it is invoked 
(e.g. editing Java vs editing HTML)? Or to have that key mapping invoke 
a different macro based on the context? If so, how?

Example:
When editing a Java file Ctrl+Shift+D inserts "hello Java"
When editing an HTML file Ctrl+Shift+D inserts "hello HTML"

-- 
Mitch

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Context aware keymapping + macro

Posted by Tim de Vries <te...@gmail.com>.
Sure, modify the code to suit.

Tim

On 2023-05-05 12:43 p.m., Mitch Claborn wrote:
> Is it possible to have a macro that is invoked via a key mapping to 
> operate differently depending on the contexts in which it is invoked 
> (e.g. editing Java vs editing HTML)? Or to have that key mapping 
> invoke a different macro based on the context? If so, how?
>
> Example:
> When editing a Java file Ctrl+Shift+D inserts "hello Java"
> When editing an HTML file Ctrl+Shift+D inserts "hello HTML"
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists