Author Topic: Keybinding to project Tools  (Read 3135 times)

skywise

  • Senior Community Member
  • Posts: 331
  • Hero Points: 10
Keybinding to project Tools
« on: May 17, 2007, 02:10:29 am »
I've added a build option to my project "BuildLib" to build some external libraries. (under the Project Tools tab so that it shows up in the Build Menu along with Build, Execute, etc)

What I'd like to do is bind a key stroke to that option.  I thought something like Build-BuildLib might show up in the keybinding dialog but nada (not too suprising), there's some options for project-usertool1 and project-user1 and 2 but binding to them didn't run that command.

Is there a way to do this?

hs2

  • Senior Community Member
  • Posts: 2744
  • Hero Points: 288
Re: Keybinding to project Tools
« Reply #1 on: May 17, 2007, 08:08:31 am »
project-build <arg==visible menu entry> should help.
I've written this small wrapper time ago due to the '_postbuild_' issue.
Could be a basis for your own wrappers b/c AFAIK you can't provide args to the commands when triggered by a key(combination).
But you could evaluate the keys and use it as args - see e.g. 'bookmark.e - alt_gtbookmark()'.

Code: [Select]
_command void build_any_target,bat ( _str buildtoolname='' ) name_info (','VSARG2_READ_ONLY|VSARG2_REQUIRES_EDITORCTL)
{
   if ( buildtoolname != '' )
   {
      activate_build ();
      reset_next_error();
      // clear_all_error_markers();
      project_build ( buildtoolname );
      call_list("_postbuild_", _project_name);
   }
   else
   {
      message ( "buildtoolname missing." );
   }
}

Good luck,

HS2