29

Text fields in almost all software erase a word when ctrl+backspace is pressed. However, Notepad behaves differently, and inserts a character which is:
`` (I copy-pasted it here. I'm not sure if it is visible. It looks like a rectangle in Notepad.)

Here is a screenshot:

ctrl+bksp

  • What is this character?
  • Why does Notepad do this? Is it simpler to implement?
  • Are there other key combinations for other characters?
  • Is there a key combination in Notepad for erasing a word?
musa
  • 571
  • 2
  • 6
  • 17

2 Answers2

32
  1. It's 0x7F "Delete" in ASCII and U+007F "Delete" in Unicode.

  2. It's in fact lack of an implementation. Plain Backspace sends an ASCII 0x08 (I'm not sure how the Edit control handles it internally), and it is not uncommon in various operating systems for CtrlBackspace to send the "Delete" sequence.

    The "delete word" behavior was added later, as an undocumented feature, and only to those Edit controls which use "SHAutoComplete". If a textbox has autocompletion disabled, CtrlBackspace will likely not work.

    (SomeMany programs implement their own text editing controls, which work slightly differently from the built-in one.)

  3. CtrlJ and CtrlM will get translated to a newline (^J is CR in ASCII and ^M is LF; however, the Edit control translates both keypresses to CR+LF.) Similarly, CtrlI inserts a Tab character.

    Ctrl_ and Ctrl^ will result in somewhat useless "Unit separator" (^_) and "Record separator" (^^).

    (The ^X notation means the Ctrl key – Ctrl-X in this example – in ASCII this is equivalent to unsetting the 7th bit of the following character.)

  4. No, but you can use CtrlShift← Left to select the previous word, and overwrite by typing.

    Or get a better Notepad.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • Thanks for the response grawity. But I don't understand why you rejected @RJFalconer's edit. [Ctrl][Left] does not _select_ without [Shift]. – musa Sep 06 '11 at 06:48
  • @musa: I didn't, that just happens when two people are editing at once. – u1686_grawity Sep 06 '11 at 07:36
  • Just for the record: Notepad2 has exactly the same problem in the Find and Replace Text dialogs that Notepad(++) has, Ctrl-Backspace does not delete the previous word. The workaround works perfect, thanks. – Michael S. Sep 05 '18 at 04:05
  • @user1686 The "undocumented feature" link doesn't lead anywhere useful (archive content notification). – rory.ap Apr 03 '20 at 17:27
7

Ctrl-Backspace to delete a word in Notepad has been finally been implemented!

See the changes to Notepad in Windows 10 version 1809. Here

Jon
  • 71
  • 1
  • 1
  • 1
    Wow, finally! Even though I rarely use plain notepad (when I forgot to change the default app to open with) I‘m still annoyed. I should install this update then. For anyone coming here in the future: 1809 was rolled out in November 2018. – bugybunny Jan 15 '19 at 10:38