Community
    • Login

    List of free keyboard shortcuts

    Scheduled Pinned Locked Moved General Discussion
    11 Posts 5 Posters 12.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • José Luis Montero CastellanosJ
      José Luis Montero Castellanos
      last edited by José Luis Montero Castellanos

      When I create a command using the Run menu, the ideal is to save it by assigning a shortcut key. The problem is that you no longer know what the available Free shorcuts combinations are.

      Ideally, in the Settings >Shorcuts Mapper… option, the lists will present all the assigned and unassigned keys, and that like the windows explorer these lists would be sorted by the column whose header is clicked.

      As this is not a requirement!, only is another idea…, "Such a list in one of the entries of the User manual, organized by function and by shortcut combination, including free combinations!..

      Do the Notepad++ have any .xml file where you can find out something about that availability?.

      For what?
      Suppose I need 5 contiguous key combinations to assign each one a Web browser.

      PeterJonesP 1 Reply Last reply Reply Quote 1
      • PeterJonesP
        PeterJones @José Luis Montero Castellanos
        last edited by PeterJones

        @José-Luis-Montero-Castellanos

        Do the Notepad++ have any .xml file where you can find out something about that availability?.

        No. Default shortcuts are compiled into the executable, so aren’t in any config file; modified shortcuts end up in shortcuts.xml.

        A few years back, someone published a script for the PythonScript plugin that shows all the active shortcuts. Unfortunately, I haven’t found it yet (I found this, which deletes all existing shortcuts… but I know there was one one that listed them all; I will search more as I have time.)

        But not even that lists all the possible shortcuts that haven’t been assigned.


        edit: Found it = https://community.notepad-plus-plus.org/topic/12576/list-of-all-assigned-keyboard-shortcuts => specifically, @Ekopalypse 's post here and the discussion below that.

        EkopalypseE 1 Reply Last reply Reply Quote 2
        • EkopalypseE
          Ekopalypse @PeterJones
          last edited by

          apparently I have not brought them up to date

          from Npp import editor, notepad, MENUCOMMAND
          import ctypes
          import ctypes.wintypes as wintypes
          from threading import Thread
          import time
          
          user32 = ctypes.WinDLL('user32', use_last_error=True)
          
          
          def start_sk_dialog():
              notepad.menuCommand(MENUCOMMAND.SETTING_SHORTCUT_MAPPER)
          
          
          sk_mapper = Thread(target=start_sk_dialog)
          sk_mapper.start()
          time.sleep(0.5)
          
          WM_USER = 1024
          WM_CLOSE = 16
          
          TCM_FIRST = 4864
          TCM_GETITEMCOUNT = (TCM_FIRST + 4)
          TCM_SETCURSEL = (TCM_FIRST + 12)
          
          BABYGRID_USER = (WM_USER + 7000)
          BGM_GETCELLDATA = BABYGRID_USER + 4
          BGM_GETROWS = BABYGRID_USER + 23
          
          
          class BGCELL(ctypes.Structure):
              _fields_ = [('row', wintypes.INT),
                          ('col', wintypes.INT)]
          
          
          def main():
              cell_buffer = ctypes.create_unicode_buffer(1000)
              bgcell = BGCELL()
          
              sk_mapper_hwnd = user32.FindWindowW(None, u'Shortcut mapper')
              if not sk_mapper_hwnd:
                  print('Shortcut mapper was not found')
                  return
          
              sys_tab_hwnd = user32.FindWindowExW(sk_mapper_hwnd, None, u'SysTabControl32', None)
              if not sys_tab_hwnd:
                  print('SysTabControl32 was not found')
                  return
          
              item_count = user32.SendMessageW(sys_tab_hwnd, TCM_GETITEMCOUNT, 0, 0)
              if not item_count:
                  print('TCM_GETITEMCOUNT returned 0')
                  return
          
              babygrid = user32.FindWindowExW(sk_mapper_hwnd, None, u'BABYGRID', None)
              if not babygrid:
                  print('BABYGRID was not found')
                  return
          
          
              shortcuts = []
              for tab in range(item_count):
                  rows = user32.SendMessageW(babygrid, BGM_GETROWS, 0, 0)
          
                  for i in range(1, rows + 1):
                      shortcut = []
          
                      for j in range(1, 3):
                          bgcell.row = i
                          bgcell.col = j
                          user32.SendMessageW(babygrid,
                                              BGM_GETCELLDATA,
                                              ctypes.byref(bgcell),
                                              cell_buffer)
                          shortcut.append(cell_buffer.value)
          
                      if shortcut[1]:
                          shortcuts.append(shortcut)
          
                  user32.SetForegroundWindow(sk_mapper_hwnd)
                  user32.SendMessageW(sys_tab_hwnd, TCM_SETCURSEL, tab, 0)
                  user32.keybd_event(0x27, 0, 0, 0)
                  user32.keybd_event(0x27, 0, 2, 0)
                  time.sleep(.1)
          
              user32.SendMessageW(sk_mapper_hwnd, WM_CLOSE, 0, 0)
          
              _max_length = len(max([x[0] for x in shortcuts], key=len))
              notepad.new()
              editor.setText('\r\n'.join(['{0:<{2}} : {1}'.format(x[0],
                                                                  x[1],
                                                                  _max_length) for x in shortcuts]))
          
          
          main()
          
          Alan KilbornA 1 Reply Last reply Reply Quote 3
          • Alan KilbornA
            Alan Kilborn @Ekopalypse
            last edited by Alan Kilborn

            @Ekopalypse said in List of free keyboard shortcuts:

            apparently I have not brought them up to date

            So the script you posted is an updated version of the script that lists the assigned keycombos for shortcuts.

            And (for those that don’t have the ability to run it), the assigned list for Notepad++ 8.4.7 with only shipped-with plugins, is:

            New                                     : Ctrl+N
            Open...                                 : Ctrl+O
            Reload from Disk                        : Ctrl+R
            Save                                    : Ctrl+S
            Save As...                              : Ctrl+Alt+S
            Save All                                : Ctrl+Shift+S
            Close                                   : Ctrl+W
            Close All                               : Ctrl+Shift+W
            Print...                                : Ctrl+P
            Exit                                    : Alt+F4
            Restore Recent Closed File              : Ctrl+Shift+T
            UPPERCASE                               : Ctrl+Shift+U
            lowercase                               : Ctrl+U
            Proper Case                             : Alt+U
            Proper Case (blend)                     : Alt+Shift+U
            Sentence case                           : Ctrl+Alt+U
            Sentence case (blend)                   : Ctrl+Alt+Shift+U
            Split Lines                             : Ctrl+I
            Join Lines                              : Ctrl+J
            Move Up Current Line                    : Ctrl+Shift+Up
            Move Down Current Line                  : Ctrl+Shift+Down
            Insert Blank Line Above Current         : Ctrl+Alt+Enter
            Insert Blank Line Below Current         : Ctrl+Alt+Shift+Enter
            Toggle Single Line Comment              : Ctrl+Q
            Single Line Comment                     : Ctrl+K
            Single Line Uncomment                   : Ctrl+Shift+K
            Block Comment                           : Ctrl+Shift+Q
            Function Completion                     : Ctrl+Spacebar
            Path Completion                         : Ctrl+Alt+Spacebar
            Word Completion                         : Ctrl+Enter
            Function Parameters Hint                : Ctrl+Shift+Spacebar
            Function Parameters Previous Hint       : Alt+Up
            Function Parameters Next Hint           : Alt+Down
            Column Editor...                        : Alt+C
            Find...                                 : Ctrl+F
            Find in Files...                        : Ctrl+Shift+F
            Find Next                               : F3
            Find Previous                           : Shift+F3
            Select and Find Next                    : Ctrl+F3
            Select and Find Previous                : Ctrl+Shift+F3
            Find (Volatile) Next                    : Ctrl+Alt+F3
            Find (Volatile) Previous                : Ctrl+Alt+Shift+F3
            Replace...                              : Ctrl+H
            Incremental Search                      : Ctrl+Alt+I
            Search Results Window                   : F7
            Previous Search Result                  : Shift+F4
            Next Search Result                      : F4
            Go to...                                : Ctrl+G
            Go to Matching Brace                    : Ctrl+B
            Select All Between Matching Braces      : Ctrl+Alt+B
            Mark...                                 : Ctrl+M
            Previous style of 1st style             : Ctrl+Shift+1
            Previous style of 2nd style             : Ctrl+Shift+2
            Previous style of 3rd style             : Ctrl+Shift+3
            Previous style of 4th style             : Ctrl+Shift+4
            Previous style of 5th style             : Ctrl+Shift+5
            Previous style of Find Mark style       : Ctrl+Shift+0
            Next style of 1st style                 : Ctrl+1
            Next style of 2nd style                 : Ctrl+2
            Next style of 3rd style                 : Ctrl+3
            Next style of 4th style                 : Ctrl+4
            Next style of 5th style                 : Ctrl+5
            Next style of Find Mark style           : Ctrl+0
            Toggle Bookmark                         : Ctrl+F2
            Next Bookmark                           : F2
            Previous Bookmark                       : Shift+F2
            Toggle Full Screen Mode                 : F11
            Post-It                                 : F12
            1st Tab                                 : Ctrl+Numpad 1
            2nd Tab                                 : Ctrl+Numpad 2
            3rd Tab                                 : Ctrl+Numpad 3
            4th Tab                                 : Ctrl+Numpad 4
            5th Tab                                 : Ctrl+Numpad 5
            6th Tab                                 : Ctrl+Numpad 6
            7th Tab                                 : Ctrl+Numpad 7
            8th Tab                                 : Ctrl+Numpad 8
            9th Tab                                 : Ctrl+Numpad 9
            Next Tab                                : Ctrl+Page down
            Previous Tab                            : Ctrl+Page up
            Move Tab Forward                        : Ctrl+Shift+Page down
            Move Tab Backward                       : Ctrl+Shift+Page up
            Switch to previous document             : Ctrl+Shift+Tab
            Switch to next document                 : Ctrl+Tab
            Hide Lines                              : Alt+H
            Focus on Another View                   : F8
            Fold All                                : Alt+0
            Unfold All                              : Alt+Shift+0
            Fold Current Level                      : Ctrl+Alt+F
            Unfold Current Level                    : Ctrl+Alt+Shift+F
            Fold Level 1                            : Alt+1
            Fold Level 2                            : Alt+2
            Fold Level 3                            : Alt+3
            Fold Level 4                            : Alt+4
            Fold Level 5                            : Alt+5
            Fold Level 6                            : Alt+6
            Fold Level 7                            : Alt+7
            Fold Level 8                            : Alt+8
            Unfold Level 1                          : Alt+Shift+1
            Unfold Level 2                          : Alt+Shift+2
            Unfold Level 3                          : Alt+Shift+3
            Unfold Level 4                          : Alt+Shift+4
            Unfold Level 5                          : Alt+Shift+5
            Unfold Level 6                          : Alt+Shift+6
            Unfold Level 7                          : Alt+Shift+7
            Unfold Level 8                          : Alt+Shift+8
            Text Direction RTL                      : Ctrl+Alt+R
            Text Direction LTR                      : Ctrl+Alt+L
            Toggle macro recording                  : Ctrl+Shift+R
            Playback                                : Ctrl+Shift+P
            Run...                                  : F5
            About Notepad++                         : F1
            Trim Trailing Space and Save            : Alt+Shift+S
            Get PHP help                            : Alt+F1
            Wikipedia Search                        : Alt+F3
            Open selected file path in new instance : Alt+F6
            SCI_CUT                                 : Ctrl+X or Shift+DEL
            SCI_COPY                                : Ctrl+C or Ctrl+INS
            SCI_PASTE                               : Ctrl+V or Shift+INS
            SCI_SELECTALL                           : Ctrl+A
            SCI_CLEAR                               : DEL
            SCI_UNDO                                : Ctrl+Z or Alt+Backspace
            SCI_REDO                                : Ctrl+Y or Ctrl+Shift+Z
            SCI_NEWLINE                             : Enter or Shift+Enter
            SCI_TAB                                 : Tab
            SCI_BACKTAB                             : Shift+Tab
            SCI_ZOOMIN                              : Ctrl+Num +
            SCI_ZOOMOUT                             : Ctrl+Num -
            SCI_SETZOOM                             : Ctrl+Num /
            SCI_SELECTIONDUPLICATE                  : Ctrl+D
            SCI_EDITTOGGLEOVERTYPE                  : INS
            SCI_LINEDOWN                            : Down
            SCI_LINEDOWNEXTEND                      : Shift+Down
            SCI_LINEDOWNRECTEXTEND                  : Alt+Shift+Down
            SCI_LINESCROLLDOWN                      : Ctrl+Down
            SCI_LINEUP                              : Up
            SCI_LINEUPEXTEND                        : Shift+Up
            SCI_LINEUPRECTEXTEND                    : Alt+Shift+Up
            SCI_LINESCROLLUP                        : Ctrl+Up
            SCI_PARADOWN                            : Ctrl+]
            SCI_PARADOWNEXTEND                      : Ctrl+Shift+]
            SCI_PARAUP                              : Ctrl+[
            SCI_PARAUPEXTEND                        : Ctrl+Shift+[
            SCI_CHARLEFT                            : Left
            SCI_CHARLEFTEXTEND                      : Shift+Left
            SCI_CHARLEFTRECTEXTEND                  : Alt+Shift+Left
            SCI_CHARRIGHT                           : Right
            SCI_CHARRIGHTEXTEND                     : Shift+Right
            SCI_CHARRIGHTRECTEXTEND                 : Alt+Shift+Right
            SCI_WORDLEFT                            : Ctrl+Left
            SCI_WORDLEFTEXTEND                      : Ctrl+Shift+Left
            SCI_WORDRIGHT                           : Ctrl+Right
            SCI_WORDRIGHTENDEXTEND                  : Ctrl+Shift+Right
            SCI_WORDPARTLEFT                        : Ctrl+/
            SCI_WORDPARTLEFTEXTEND                  : Ctrl+Shift+/
            SCI_WORDPARTRIGHT                       : Ctrl+\
            SCI_WORDPARTRIGHTEXTEND                 : Ctrl+Shift+\
            SCI_HOMEDISPLAY                         : Alt+Home
            SCI_VCHOMERECTEXTEND                    : Alt+Shift+Home
            SCI_VCHOMEWRAP                          : Home
            SCI_VCHOMEWRAPEXTEND                    : Shift+Home
            SCI_LINEENDWRAPEXTEND                   : Shift+End
            SCI_LINEENDRECTEXTEND                   : Alt+Shift+End
            SCI_LINEENDDISPLAY                      : Alt+End
            SCI_LINEENDWRAP                         : End
            SCI_DOCUMENTSTART                       : Ctrl+Home
            SCI_DOCUMENTSTARTEXTEND                 : Ctrl+Shift+Home
            SCI_DOCUMENTEND                         : Ctrl+End
            SCI_DOCUMENTENDEXTEND                   : Ctrl+Shift+End
            SCI_PAGEUP                              : Page up
            SCI_PAGEUPEXTEND                        : Shift+Page up
            SCI_PAGEUPRECTEXTEND                    : Alt+Shift+Page up
            SCI_PAGEDOWN                            : Page down
            SCI_PAGEDOWNEXTEND                      : Shift+Page down
            SCI_PAGEDOWNRECTEXTEND                  : Alt+Shift+Page down
            SCI_DELETEBACK                          : Backspace or Shift+Backspace
            SCI_DELWORDLEFT                         : Ctrl+Backspace
            SCI_DELWORDRIGHT                        : Ctrl+DEL
            SCI_DELLINELEFT                         : Ctrl+Shift+Backspace
            SCI_DELLINERIGHT                        : Ctrl+Shift+DEL
            SCI_LINEDELETE                          : Ctrl+Shift+L
            SCI_LINECUT                             : Ctrl+L
            SCI_LINECOPY                            : Ctrl+Shift+X
            SCI_LINETRANSPOSE                       : Ctrl+T
            SCI_CANCEL                              : Esc```
            1 Reply Last reply Reply Quote 1
            • Alan KilbornA
              Alan Kilborn
              last edited by Alan Kilborn

              I took the output from that script, and attempted a script to produce the list of unassigned (or “free”) keycombos.

              I don’t know that I feel good that this script gets it 100% right (trying to “eyeball validate” it is painful), but here is its listing and output:

              ShortcutMapperUnassignedKeyCombos.py :

              # -*- coding: utf-8 -*-
              from __future__ import print_function
              
              # THIS SCRIPT TAKES AS INPUT THE OUTPUT OF ANOTHER SCRIPT, FOR THAT SCRIPT, SEE:
              #  https://community.notepad-plus-plus.org/topic/23749/list-of-free-keyboard-shortcuts
              #  and look for the "Nov 16, 2022, 5:30 AM" posting
              
              # HAVE THE OUTPUT OF THAT IN THE ACTIVE TAB WHEN RUNNING THIS SCRIPT
              
              from Npp import *
              import re
              
              #-------------------------------------------------------------------------------
              
              class SMUKC(object):
              
                  def __init__(self):
                      basekey_list = [
                          'Num *',
                          'Num +',
                          'Num -',
                          'Num .',
                          'Num /',
                          'Backspace',
                          'Tab',
                          'Enter',
                          'Esc',
                          'Spacebar',
                          'Page up',
                          'Page down',
                          'End',
                          'Home',
                          'Left',
                          'Up',
                          'Right',
                          'Down',
                          'INS',
                          'DEL',
                          '~',
                          '-',
                          '=',
                          '[',
                          ']',
                          ';',
                          "'",
                          '\\',
                          ',',
                          '.',
                          '/',
                      ]
                      basekeys_that_require_modifier_list = [
                          'Spacebar',
                          '~',
                          '-',
                          '=',
                          '[',
                          ']',
                          ';',
                          "'",
                          '\\',
                          ',',
                          '.',
                          '/',
                      ]
                      for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789':
                          basekey_list.append(ch)
                          basekeys_that_require_modifier_list.append(ch)
                      for f in range(12): basekey_list.append('F{}'.format(f + 1))  # function keys
                      if 1:  # numeric keypad keys
                          for np_numbers in range(10): basekey_list.append('Numpad {}'.format(np_numbers))
                          for np_other in '*+-./': basekey_list.append('Num {}'.format(np_other))
                      modifier_list_by_basekey_dict = {}
                      ctrl_bitweight = 0b0100; alt_bitweight = 0b0010; shift_bitweight = 0b0001; no_modifier_bitweight = 0b1000
                      for bk in basekey_list:
                          modifier_list_by_basekey_dict[bk] = []
                          if bk in basekeys_that_require_modifier_list:
                              modifier_list_by_basekey_dict[bk].extend([ no_modifier_bitweight, shift_bitweight ])
                      input_text = editor.getText()
                      for input_line in input_text.splitlines():
                          (command, shortcut_s) = input_line.split(':')
                          shortcut_s = shortcut_s.strip()
                          for sc in shortcut_s.split(' or '):
                              m = re.match(r'^(?:(?P<ctrl>Ctrl)\+)?(?:(?P<alt>Alt)\+)?(?:(?P<shift>Shift)\+)?(?P<basekey>.+)', sc)
                              assert(m)
                              ncas_bitweights = 0b0000
                              if m.group(1): ncas_bitweights |= ctrl_bitweight
                              if m.group(2): ncas_bitweights |= alt_bitweight
                              if m.group(3): ncas_bitweights |= shift_bitweight
                              if not m.group(1) and not m.group(2) and not m.group(3): ncas_bitweights |= no_modifier_bitweight
                              basekey = m.group(4)
                              if not basekey in modifier_list_by_basekey_dict:
                                  print('encountered basekey not in the list in the code:', basekey)
                                  assert 0
                              modifier_list_by_basekey_dict[basekey].append(ncas_bitweights)
                      basekey_max_length = len(max([x for x in modifier_list_by_basekey_dict], key=len))
                      possible_modifiers_list = [ 'Unmodified', 'Shift', 'Alt', 'Alt+Shift', 'Ctrl', 'Ctrl+Shift', 'Ctrl+Alt', 'Ctrl+Alt+Shift' ]
                      output_line_list = []
                      for bk in modifier_list_by_basekey_dict:
                          unassigned_modifiers_set_str = ''
                          for mod_index in range(len(possible_modifiers_list)):
                              hacked_mod_index = no_modifier_bitweight if mod_index == 0 else mod_index  # really bad hack :-(
                              if hacked_mod_index not in modifier_list_by_basekey_dict[bk]:
                                  unassigned_modifiers_set_str += possible_modifiers_list[mod_index] + ', '
                          unassigned_modifiers_set_str = unassigned_modifiers_set_str[:-2]  # remove trailing , and space
                          if len(unassigned_modifiers_set_str) == 0: unassigned_modifiers_set_str = 'All-combos-are-assigned!'
                          out_line = '{bk:<{bkml}} {ums}'.format(bk=bk, bkml=basekey_max_length, ums=unassigned_modifiers_set_str)
                          output_line_list.append(out_line)
                      output_line_list.sort()
                      output_line_list.insert(0, 'BASE KEY AND UNASSIGNED MODIFIER COMBOS:')
                      notepad.new()
                      editor.setText('\r\n'.join(output_line_list))
                      editor.setSavePoint()
              
              #-------------------------------------------------------------------------------
              
              if __name__ == '__main__': SMUKC()
              

              The output:

              BASE KEY AND UNASSIGNED MODIFIER COMBOS:
              '         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              ,         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              -         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              .         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              /         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              0         Ctrl+Alt, Ctrl+Alt+Shift
              1         Ctrl+Alt, Ctrl+Alt+Shift
              2         Ctrl+Alt, Ctrl+Alt+Shift
              3         Ctrl+Alt, Ctrl+Alt+Shift
              4         Ctrl+Alt, Ctrl+Alt+Shift
              5         Ctrl+Alt, Ctrl+Alt+Shift
              6         Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              7         Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              8         Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              9         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              ;         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              =         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              A         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              B         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt+Shift
              Backspace Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              C         Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              D         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              DEL       Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Down      Ctrl+Alt, Ctrl+Alt+Shift
              E         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              End       Ctrl+Alt, Ctrl+Alt+Shift
              Enter     Alt, Alt+Shift, Ctrl+Shift
              Esc       Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F         Alt, Alt+Shift
              F1        Shift, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F10       Unmodified, Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F11       Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F12       Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F2        Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F3        Alt+Shift
              F4        Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F5        Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F6        Unmodified, Shift, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F7        Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F8        Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              F9        Unmodified, Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              G         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              H         Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Home      Ctrl+Alt, Ctrl+Alt+Shift
              I         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt+Shift
              INS       Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              J         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              K         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              L         Alt, Alt+Shift, Ctrl+Alt+Shift
              Left      Alt, Ctrl+Alt, Ctrl+Alt+Shift
              M         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              N         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Num *     Unmodified, Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Num +     Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Num -     Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Num .     Unmodified, Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Num /     Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 0  Unmodified, Shift, Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 1  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 2  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 3  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 4  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 5  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 6  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 7  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 8  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Numpad 9  Unmodified, Shift, Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              O         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              P         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Page down Alt, Ctrl+Alt, Ctrl+Alt+Shift
              Page up   Alt, Ctrl+Alt, Ctrl+Alt+Shift
              Q         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              R         Alt, Alt+Shift, Ctrl+Alt+Shift
              Right     Alt, Ctrl+Alt, Ctrl+Alt+Shift
              S         Alt, Ctrl+Alt+Shift
              Spacebar  Alt, Alt+Shift, Ctrl+Alt+Shift
              T         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Tab       Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              U         All-combos-are-assigned!
              Up        Ctrl+Alt, Ctrl+Alt+Shift
              V         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              W         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              X         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Y         Alt, Alt+Shift, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              Z         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              [         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              \         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              ]         Alt, Alt+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              ~         Alt, Alt+Shift, Ctrl, Ctrl+Shift, Ctrl+Alt, Ctrl+Alt+Shift
              

              Something that I didn’t know that came out of this: All possible combos involving U are assigned by default!

              José Luis Montero CastellanosJ 1 Reply Last reply Reply Quote 3
              • Alan KilbornA Alan Kilborn referenced this topic on
              • José Luis Montero CastellanosJ
                José Luis Montero Castellanos @Alan Kilborn
                last edited by José Luis Montero Castellanos

                @Alan-Kilborn
                Hello:
                I am speechless, there are still quite a few unassigned keyboard shortcuts.
                I’m going to make a copy and save it in the same Notepad++ folder to keep it handy. Also the script.
                I thank you for your kind contribution, which I hope everyone can take advantage of and benefit from.
                I think I have a way to attach it to the offline “user manual” :)

                Success in your work!

                1 Reply Last reply Reply Quote 0
                • TBugReporterT TBugReporter referenced this topic on
                • Alan KilbornA Alan Kilborn referenced this topic on
                • TBugReporterT TBugReporter referenced this topic on
                • Alan KilbornA Alan Kilborn referenced this topic on
                • TBugReporterT TBugReporter referenced this topic on
                • notdodgeballN
                  notdodgeball
                  last edited by

                  I can’t thank @Alan-Kilborn enough for his script, it really helped me. It’s anxiety inducing setting a custom shortcut not knowing if there is a better and more ergonomic one out there going to waste, for me at least.

                  With the new mutli-select shortcuts the script may fail because of the colon char in some of it’s descriptions. So I fixed that and also added the <> “key”, which was missing.

                  I also joined them as one, hope that’s ok:

                  # -*- coding: utf-8 -*-
                  # Authors: Ekopalypse and Alan Kilborn
                  # https://community.notepad-plus-plus.org/topic/23749/list-of-free-keyboard-shortcuts
                  
                  from threading import Thread
                  import re
                  import ctypes
                  import ctypes.wintypes as wintypes
                  import time
                  
                  def ek():
                      user32 = ctypes.WinDLL('user32', use_last_error=True)
                  
                      def start_sk_dialog():
                          notepad.menuCommand(MENUCOMMAND.SETTING_SHORTCUT_MAPPER)
                  
                      sk_mapper = Thread(target=start_sk_dialog)
                      sk_mapper.start()
                      time.sleep(0.5)
                  
                      WM_USER = 1024
                      WM_CLOSE = 16
                  
                      TCM_FIRST = 4864
                      TCM_GETITEMCOUNT = (TCM_FIRST + 4)
                      TCM_SETCURSEL = (TCM_FIRST + 12)
                  
                      BABYGRID_USER = (WM_USER + 7000)
                      BGM_GETCELLDATA = BABYGRID_USER + 4
                      BGM_GETROWS = BABYGRID_USER + 23
                  
                      class BGCELL(ctypes.Structure):
                          _fields_ = [('row', wintypes.INT),
                                      ('col', wintypes.INT)]
                  
                      cell_buffer = ctypes.create_unicode_buffer(1000)
                      bgcell = BGCELL()
                  
                      sk_mapper_hwnd = user32.FindWindowW(None, u'Shortcut mapper')
                      if not sk_mapper_hwnd:
                          print('Shortcut mapper was not found')
                          return
                  
                      sys_tab_hwnd = user32.FindWindowExW(sk_mapper_hwnd, None, u'SysTabControl32', None)
                      if not sys_tab_hwnd:
                          print('SysTabControl32 was not found')
                          return
                  
                      item_count = user32.SendMessageW(sys_tab_hwnd, TCM_GETITEMCOUNT, 0, 0)
                      if not item_count:
                          print('TCM_GETITEMCOUNT returned 0')
                          return
                  
                      babygrid = user32.FindWindowExW(sk_mapper_hwnd, None, u'BABYGRID', None)
                      if not babygrid:
                          print('BABYGRID was not found')
                          return
                  
                  
                      shortcuts = []
                      for tab in range(item_count):
                          rows = user32.SendMessageW(babygrid, BGM_GETROWS, 0, 0)
                  
                          for i in range(1, rows + 1):
                              shortcut = []
                  
                              for j in range(1, 3):
                                  bgcell.row = i
                                  bgcell.col = j
                                  user32.SendMessageW(babygrid,
                                                      BGM_GETCELLDATA,
                                                      ctypes.byref(bgcell),
                                                      cell_buffer)
                                  shortcut.append(cell_buffer.value)
                  
                              if shortcut[1]:
                                  shortcuts.append(shortcut)
                  
                          user32.SetForegroundWindow(sk_mapper_hwnd)
                          user32.SendMessageW(sys_tab_hwnd, TCM_SETCURSEL, tab, 0)
                          user32.keybd_event(0x27, 0, 0, 0)
                          user32.keybd_event(0x27, 0, 2, 0)
                          time.sleep(.1)
                  
                      user32.SendMessageW(sk_mapper_hwnd, WM_CLOSE, 0, 0)
                  
                      _max_length = len(max([x[0] for x in shortcuts], key=len))
                  
                      editor.appendText('\r\n'.join(['{0:<{2}} : {1}'.format(x[0],
                                                                          x[1],
                                                                          _max_length) for x in shortcuts]))
                  
                  def ak():
                          basekey_list = [
                              'Num *',
                              'Num +',
                              'Num -',
                              'Num .',
                              'Num /',
                              'Backspace',
                              'Tab',
                              'Enter',
                              'Esc',
                              'Spacebar',
                              'Page up',
                              'Page down',
                              'End',
                              'Home',
                              'Left',
                              'Up',
                              'Right',
                              'Down',
                              'INS',
                              'DEL',
                              '~',
                              '-',
                              '=',
                              '[',
                              ']',
                              ';',
                              "'",
                              '\\',
                              ',',
                              '.',
                              '/',
                              '<>',
                          ]
                          basekeys_that_require_modifier_list = [
                              'Spacebar',
                              '~',
                              '-',
                              '=',
                              '[',
                              ']',
                              ';',
                              "'",
                              '\\',
                              ',',
                              '.',
                              '/',
                              '<>',
                          ]
                          for ch in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789':
                              basekey_list.append(ch)
                              basekeys_that_require_modifier_list.append(ch)
                          for f in range(12): basekey_list.append('F{}'.format(f + 1))  # function keys
                          if 1:  # numeric keypad keys
                              for np_numbers in range(10): basekey_list.append('Numpad {}'.format(np_numbers))
                              for np_other in '*+-./': basekey_list.append('Num {}'.format(np_other))
                          modifier_list_by_basekey_dict = {}
                          ctrl_bitweight = 0b0100; alt_bitweight = 0b0010; shift_bitweight = 0b0001; no_modifier_bitweight = 0b1000
                          for bk in basekey_list:
                              modifier_list_by_basekey_dict[bk] = []
                              if bk in basekeys_that_require_modifier_list:
                                  modifier_list_by_basekey_dict[bk].extend([ no_modifier_bitweight, shift_bitweight ])
                          input_text = editor.getText()
                          for input_line in input_text.splitlines():
                              (command, shortcut_s) = input_line.rsplit(':',1)
                              shortcut_s = shortcut_s.strip()
                              for sc in shortcut_s.split(' or '):
                                  m = re.match(r'^(?:(?P<ctrl>Ctrl)\+)?(?:(?P<alt>Alt)\+)?(?:(?P<shift>Shift)\+)?(?P<basekey>.+)', sc)
                                  assert(m)
                                  ncas_bitweights = 0b0000
                                  if m.group(1): ncas_bitweights |= ctrl_bitweight
                                  if m.group(2): ncas_bitweights |= alt_bitweight
                                  if m.group(3): ncas_bitweights |= shift_bitweight
                                  if not m.group(1) and not m.group(2) and not m.group(3): ncas_bitweights |= no_modifier_bitweight
                                  basekey = m.group(4)
                                  if not basekey in modifier_list_by_basekey_dict:
                                      print('encountered basekey not in the list in the code:', basekey)
                                      assert 0
                                  modifier_list_by_basekey_dict[basekey].append(ncas_bitweights)
                          basekey_max_length = len(max([x for x in modifier_list_by_basekey_dict], key=len))
                          possible_modifiers_list = [ 'Unmodified', 'Shift', 'Alt', 'Alt+Shift', 'Ctrl', 'Ctrl+Shift', 'Ctrl+Alt', 'Ctrl+Alt+Shift' ]
                          output_line_list = []
                          for bk in modifier_list_by_basekey_dict:
                              unassigned_modifiers_set_str = ''
                              for mod_index in range(len(possible_modifiers_list)):
                                  hacked_mod_index = no_modifier_bitweight if mod_index == 0 else mod_index  # really bad hack :-(
                                  if hacked_mod_index not in modifier_list_by_basekey_dict[bk]:
                                      unassigned_modifiers_set_str += possible_modifiers_list[mod_index] + ', '
                              unassigned_modifiers_set_str = unassigned_modifiers_set_str[:-2]  # remove trailing , and space
                              if len(unassigned_modifiers_set_str) == 0: unassigned_modifiers_set_str = 'All-combos-are-assigned!'
                              out_line = '{bk:<{bkml}} {ums}'.format(bk=bk, bkml=basekey_max_length, ums=unassigned_modifiers_set_str)
                              output_line_list.append(out_line)
                          output_line_list.sort()
                          output_line_list.insert(0, '\n\nBASE KEY AND UNASSIGNED MODIFIER SHORTCUTS:\n')
                          editor.appendText('\n'.join(output_line_list))
                  
                  def main():
                      notepad.new()
                      ek()
                      ak()
                      editor.addText('ASSIGNED SHORTCUTS\n\n')
                      # editor.setSavePoint()
                  
                  main()
                  
                  
                  Alan KilbornA 1 Reply Last reply Reply Quote 1
                  • notdodgeballN notdodgeball referenced this topic on
                  • Alan KilbornA
                    Alan Kilborn @notdodgeball
                    last edited by

                    @notdodgeball said in List of free keyboard shortcuts:

                    and also added the <> “key”, which was missing

                    What’s the “<> key” ?

                    notdodgeballN 1 Reply Last reply Reply Quote 0
                    • notdodgeballN
                      notdodgeball @Alan Kilborn
                      last edited by notdodgeball

                      @Alan-Kilborn, this one:

                      4a94f874-9c6b-4c37-ac56-dd38d52eba54-image.png

                      It’s not really a key per se, unless you are using the German layout, not sure how it’s handled in the US layout though.

                      Alan KilbornA 1 Reply Last reply Reply Quote 0
                      • Alan KilbornA
                        Alan Kilborn @notdodgeball
                        last edited by

                        @notdodgeball

                        Interesting; I’ve never noticed that “key” before.
                        And I still don’t know what it is. :-P

                        PeterJonesP 1 Reply Last reply Reply Quote 0
                        • PeterJonesP
                          PeterJones @Alan Kilborn
                          last edited by

                          @Alan-Kilborn said in List of free keyboard shortcuts:

                          Interesting; I’ve never noticed that “key” before.
                          And I still don’t know what it is. :-P

                          VK_OEM_102. It’s a key on some international keyboards, not on standard US keyboards.

                          The third post of the shortcuts FAQ has the <> listed, and you’ll see it has a description in the French column but not US column. And @dinkumoil’s German description and @notdodgeball’s Portuguese description show what the key maps to on those keyboards

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors