0

I'd like to generate a list of key bindings that are unpopulated in SlickEdit 18.0.0+

Is there a simple way to do this?

Currently, when I write a new macro, I have to hunt and peck trying various combinations to find if there is a key sequence I can live without.

The only thing I found on the interweb was a mailing list feature request for this, and the SlickEdit employee recommended using the command line interface instead of a bound hotkey. Not quite what I'm hoping for.

kmort
  • 2,848
  • 2
  • 32
  • 54

1 Answers1

1

I am using v17 but 'unused keys' is an infinite set since it is a multi-key hotkey system. I imagine it can be done based on the existing key-tree, but I would not want to write it.

If you are looking for a quick manual way to find empty key-paths, use the following:

// list keys in sorted fashion to new buffer
_command list_keydefs()
// Find command assigned to a key-path
_command what_is()
// Find commands assigned to key-paths
_command what_are()
// Find key-paths assigned to command
_command where_is(_str commandName='', _str quiet='',_str separatorChar=',') name_info(COMMAND_ARG',')
// Bind to a key
_command bind_to_key(_str commandName='') name_info(COMMAND_ARG',')
// Bind current word (proc name) to key
_command bind_cur_word_alt(){
  if (command_state()) {
    return(0);
  }
  _str s=cur_word(0);
  if (s==''||!is_cmd(s)) {
    s=current_proc_name(false);
  }
  if (!is_cmd(s)) {
    _message_box(s' is not a command');
    return(0);
  }
  _str sa=letter_prompt('Number of Keys or 0 to Quit','1234567890');
  if (sa==''||sa=='0') {
    _message_box(1);return(0);
  }
  _str ss='-'sa' -r 's;
  bind_to_key(ss);
  ss=where_is(s,1);
  sticky_message(ss);
}
// utils
_command is_cmd(...){
  _str p=current_proc(false);//was current_proc_name
  if (arg()==1) {
    p=arg(1);
  }
  return(find_index(p,COMMAND_TYPE)!=0);
}
Mark Robbins
  • 2,427
  • 3
  • 24
  • 33
  • Thank you for the answer Mark. I'm not quite sure how to use it. I tried to put it in a macro, but it didn't work. Can you point me in the right direction? – kmort Mar 27 '14 at 12:34
  • @kmort The _commands without bodies are built-in, you can use them from the SE command line (esc), or assign them to a key. The _commands with a body can be placed in vusermacs.e, then `load` that file so it compiles, then they will be available for use like the built-ins. Example: press , type list-keydefs and you should get a list of keys in a new buffer. – Mark Robbins Mar 27 '14 at 13:27
  • You're a genius my friend. :-) – kmort Mar 27 '14 at 16:04