{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/winforms/issues/259","repository_url":"https://api.github.com/repos/dotnet/winforms","labels_url":"https://api.github.com/repos/dotnet/winforms/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/winforms/issues/259/comments","events_url":"https://api.github.com/repos/dotnet/winforms/issues/259/events","html_url":"https://github.com/dotnet/winforms/issues/259","id":392410849,"node_id":"MDU6SXNzdWUzOTI0MTA4NDk=","number":259,"title":"Create proper Ctrl+Backspace shortcut in TextBox","user":{"login":"ArrowCase","id":44978869,"node_id":"MDQ6VXNlcjQ0OTc4ODY5","avatar_url":"https://avatars0.githubusercontent.com/u/44978869?v=4","gravatar_id":"","url":"https://api.github.com/users/ArrowCase","html_url":"https://github.com/ArrowCase","followers_url":"https://api.github.com/users/ArrowCase/followers","following_url":"https://api.github.com/users/ArrowCase/following{/other_user}","gists_url":"https://api.github.com/users/ArrowCase/gists{/gist_id}","starred_url":"https://api.github.com/users/ArrowCase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArrowCase/subscriptions","organizations_url":"https://api.github.com/users/ArrowCase/orgs","repos_url":"https://api.github.com/users/ArrowCase/repos","events_url":"https://api.github.com/users/ArrowCase/events{/privacy}","received_events_url":"https://api.github.com/users/ArrowCase/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-12-19T02:05:25Z","updated_at":"2018-12-19T18:09:40Z","closed_at":null,"author_association":"NONE","body":"In Windows, `Ctrl+Backspace` commonly serves as a shortcut to delete the word immediately preceding the cursor. It is equivalent to `Ctrl+Shift+Left` followed by `Backspace`.\r\n\r\nIn WinForms, this shortcut works only in single-line `TextBox` controls which have autocomplete enabled. This is actually built into `SHAutoComplete` somewhere in the win32 API, and is a \"rogue feature\" with no documentation (some history [here](https://blogs.msdn.microsoft.com/oldnewthing/20071011-00/?p=24823)). If the `TextBox` is multi-line or doesn't have autocomplete on, `Ctrl+Backspace` inserts a DELETE character (ASCII 127) instead.\r\n\r\nNote: The `Ctrl+Delete` shortcut (which deletes the word following the cursor) works in all relevant WinForms controls.\r\n\r\nOutside of WinForms, the `Ctrl+Backspace` shortcut is nearly ubiquitous on Windows (as of October 2018, even Notepad finally has it!). As such, I propose properly implementing it in WinForms controls such as `TextBoxBase` and `ComboBox` with a custom handler for `Ctrl+Backspace`.\r\n\r\n***\r\n\r\nI've submitted a PR with one approach to add this shortcut, namely ~~using `SendInput`~~ sending native messages to simulate the aforementioned `Ctrl+Shift+Left, Backspace` keystrokes. I believe this is the right approach — as even the current autocomplete `TextBox` \"feature\" seems to be selecting the text and then deleting it if you watch closely.\r\n\r\nAnother possibility would be to use internal text selection functions rather than sending keystrokes. However, that requires replicating the logic dealing with word boundaries/punctuation currently used by `Ctrl+Shift+Left`, which is a bit quirky, not to mention wildly inconsistent between different Windows programs. We can consider this approach if the current PR is lacking."},"comment":{"url":"https://api.github.com/repos/dotnet/winforms/issues/comments/448691459","html_url":"https://github.com/dotnet/winforms/issues/259#issuecomment-448691459","issue_url":"https://api.github.com/repos/dotnet/winforms/issues/259","id":448691459,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODY5MTQ1OQ==","user":{"login":"jnm2","id":8040367,"node_id":"MDQ6VXNlcjgwNDAzNjc=","avatar_url":"https://avatars2.githubusercontent.com/u/8040367?v=4","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"created_at":"2018-12-19T18:09:40Z","updated_at":"2018-12-19T18:09:40Z","author_association":"NONE","body":"I live by Ctrl+Back/Del/Left/Right. It doesn't have the awareness of users and implementors that it should have for how much it improves quality of keyboard usage."}}
{"actor":{"display_login":"jnm2"}}