Author Topic: Bind Command to Key for "project-usertool ..."  (Read 7486 times)

at5dapa1

  • Senior Community Member
  • Posts: 284
  • Hero Points: 24
Bind Command to Key for "project-usertool ..."
« on: October 11, 2006, 09:41:52 AM »
I have a project user tool, called "PCLint", which is listed immediately after "Build   Ctrl+F9", into the Build menu.
I want to assign the shortcut key to it, which also must appear as assigned key, into the Build menu, where the tool is listed.
Does anybody know how to do this?

If I go to "Bind Command to Key" dialog, and at the Command-editbox I write "project-usertool" the Bind button is active, but if I add anything else, the Bind buttons became disabled.  :( How can I set the parameter which must be passed to the project_usertool function?

Is there any other way than writing a macro and assigning the key to the macro? In CodeWright was possible to assign a key to "ExecTool 5", for example, which means it will start the 5th user defined tool.

Thanks,
Daniel

at5dapa1

  • Senior Community Member
  • Posts: 284
  • Hero Points: 24
Re: Bind Command to Key for "project-usertool ..."
« Reply #1 on: October 11, 2006, 09:54:37 AM »
PS: I'm using SlickEdit v11.02.
Also, I can set a toolbar button with the Command: "project-usertool PCLint", and it works, but again the "Bind to Key..." button is disabled.

alex

  • Community Member
  • Posts: 64
  • Hero Points: 6
Re: Bind Command to Key for "project-usertool ..."
« Reply #2 on: October 11, 2006, 11:01:41 AM »
The only way I personally know how to do this is to write a wrapper macro (which I put in vusrmarcs.e).

Here's an example:

Code: [Select]
_command build_pc_lint() name_info(','VSARG2_MACRO|VSARG2_EDITORCTL)
{
   project_usertool( 'PCLint');
}

If you're new to macros: you'll need to create a vusrmacs.e file before putting this in.  You can do that very quickly by going to Macro->Record Macro, then Macro->Stop Recording Macro and save that macro.  Then go to your SlickEdit config directory (for me with vs 11.0.2, it's under My Documents\My SlickEdit Config\<latest version>) and open the vusrmacs.e file.  Add the macro you want, go to Macro->Load Module and then load your vusrmacs.e file from here to compile it and make it active.  Then you should be able to find hte build_pc_lint command in the list of key bindings.  You can also find it in the list of macros, which might save you a few seconds of searching (Macros->List Macros).

at5dapa1

  • Senior Community Member
  • Posts: 284
  • Hero Points: 24
Re: Bind Command to Key for "project-usertool ..."
« Reply #3 on: October 12, 2006, 12:43:44 PM »
Thanks Alex,
seems that's the only way!