Author Topic: More assignable keys via macros  (Read 1575 times)

mpenacho

  • New Community Member
  • Posts: 1
  • Hero Points: 0
More assignable keys via macros
« on: July 29, 2012, 01:58:43 PM »
More assignable keys via macros:
   There are #defines for alt-keys (A_UP, A_DOWN), shift-keys (S_TAB, S_F9), control-keys (C_DEL, C_N).
   I would really like to have combinations available, namely these:
      execute('bind-to-key mp_scroll_window_down 'event2index(C_S_DOWN));
      execute('bind-to-key mp_scroll_window_up 'event2index(C_S_UP));
      execute('bind-to-key mp_convert_bin_to_hex 'event2index(C_S_N));
      execute('bind-to-key mp_invert_hex 'event2index(C_A_S_N));
      execute('bind-to-key mp_convert_hex_to_ascii 'event2index(C_'));
      execute('bind-to-key mp_convert_ascii_to_hex 'event2index(C_S_'));
      execute('bind-to-key maybe_split_insert_line 'event2index(C_ENTER));
      execute('bind-to-key rubout 'event2index(S_BACKSPACE));

   (although C_' would probably have to be something like C_TICK)

Sort the entries in the box that pops up after a PUSH_TAG by project, putting the current project first:
   I keep several, very similar projects in my workspace, and switch between them several times a day.  Since these have many duplicate, or nearly duplicate files, when I press my 'push-tag' key (ctrl-.), sometimes as many as a dozen file locations will pop up as potential function sources.  I then have to manually find the file location in the list that corresponds to my current project.  If it sorted the list by project, putting the files from the current project first, this would save me a lot of accidental errors.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: More assignable keys via macros
« Reply #1 on: July 30, 2012, 06:35:02 AM »
More assignable keys via macros:
   There are #defines for alt-keys (A_UP, A_DOWN), shift-keys (S_TAB, S_F9), control-keys (C_DEL, C_N).
   I would really like to have combinations available, namely these:
      execute('bind-to-key mp_scroll_window_down 'event2index(C_S_DOWN));
...

I think you might be looking for the name2event() function:

Code: [Select]
event2index(name2event("C-S-DOWN"))