Community
    • Login

    Disable ASCII Control characters shortcuts?

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    24 Posts 8 Posters 39.8k 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.
    • Alan KilbornA
      Alan Kilborn @Alan Kilborn
      last edited by

      @Alan-Kilborn said in Disable ASCII Control characters shortcuts?:

      but if you mean can Notepad++ alone achieve it, the answer is No, it can’t.

      In light of @mkupper 's post, I’ll qualify mine:

      I sensed the recent poster was looking for a simple checkbox of the form:

      • Disallow control character entry via typing

      And, as that preference setting doesn’t exist, I said it couldn’t be done with Notepad++.

      Obviously, one can come up with a list of unassigned Ctrl+??? combinations and create do-nothing macros for all of them (I suppose there aren’t too many).

      However, I’d suggest assigning a SCI_NULL operation to them; SCI_NULL is Scintilla command id 2172.

      1 Reply Last reply Reply Quote 2
      • M
        MaximilianKohler
        last edited by

        Thanks @mkupper! It looks like the way to implement that would be to edit the shortcuts.xml file and paste in those lines you shared.
        npp-user-manual dot org/docs/macros/

        I guess for the Scintilla method we edit the same file with a similar format, replacing the existing <ScintillaKeys /> line.

        For now, I’ve just assigned basic hotkeys to the main ones I was having trouble with.

        mkupperM 1 Reply Last reply Reply Quote 1
        • mkupperM
          mkupper @MaximilianKohler
          last edited by

          @MaximilianKohler said in Disable ASCII Control characters shortcuts?:

          It looks like the way to implement that would be to edit the shortcuts.xml file and paste in those lines you shared.
          npp-user-manual dot org/docs/macros/

          That is correct. I have not looked at github yet to see if there is not already a feature request too add a setting Ignore unrecognized keyboard Ctrl codes. I don’t know if it would be easy or hard to implement as I don’t know if the fall-through path for unrecognized keyboard codes is in Notepad++, meaning it should be easy to code, or if keystrokes are passed to Scintilla in hopes that they are recognized.

          My guess is that the unrecognized keystrokes go to Scintilla which then passes then on to Windows. Applications such as Notepad++ are supposed to look for things that they care about and pass the rest on to Scintilla which looks for things it cares about and passes the rest on to Windows. Windows’ keystroke handler will be looking for Alt-F4 and similar things and converting them into messages such as WM_QUIT to exit the application.

          Thus, it may well not be at all easy for Notepad++ to have an Ignore unrecognized keyboard Ctrl codes setting.

          Alan KilbornA 1 Reply Last reply Reply Quote 3
          • Alan KilbornA
            Alan Kilborn @mkupper
            last edited by Alan Kilborn

            @mkupper said in Disable ASCII Control characters shortcuts?:

            it may well not be at all easy for Notepad++ to have an Ignore unrecognized keyboard Ctrl codes setting.

            Actually, it should be fairly easy.
            And the script I linked to yesterday (and everyone since then has so far ignored) shows what would need to be done:
            Prevent WM_CHAR codes for the control character range from reaching Scintilla, where they are processed by putting the corresponding character in the document.


            By the way, people in the future will come read this thread, so it is best to post “correct” information.

            This is not how to define a correct action tag to solve the problem; one example from above:

            <Macro name="RemoveKey_Ctrl_Shift_X_CAN" Ctrl="yes" Alt="no" Shift="yes" Key="88">
                <Action type="" message="" wParam="" lParam="" sParam="" />
            </Macro>
            

            The correct equivalent would be:

            <Macro name="RemoveKey_Ctrl_Shift_X_CAN" Ctrl="yes" Alt="no" Shift="no" Key="88">
                <Action type="0" message="2172" wParam="0" lParam="0" sParam="" />
            </Macro>
            

            Reference: https://npp-user-manual.org/docs/config-files/#macros:~:text=Attributes for the <Action> tag

            1 Reply Last reply Reply Quote 2
            • Alan KilbornA Alan Kilborn referenced this topic on
            • mkupperM mkupper referenced this topic on
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors