#511 closed enhancement (fixed)
[PATCH] Make Ctrl+Backspace/Delete remove entire words in input controls
Reported by: | Erik Johansson | Owned by: | Kenny Long |
---|---|---|---|
Priority: | If Time Permits | Milestone: | Alpha 6 |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description
Currently ctrl+backspace/delete is ignored completely, which is better than how some programs react to it (i.e. placing an "unknown character" box instead of removing the entire word - I'm looking at you Photoshop =) ). It would be nice to have it working like this: Ctrl+Backspace = remove the word to the left of the cursor (i.e. the entire word left of the cursor, nothing to the right of the cursors), Ctrl+Delete the same but on the right side of the cursor.
As you can see by the priority it's not something too important, but it would be nice to have it working, and it can be a good relatively simple task for someone wanting to get more familiar with the engine.
Attachments (1)
Change History (14)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:4 by , 14 years ago
Milestone: | → Backlog |
---|
comment:5 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:6 by , 13 years ago
Status: | new → assigned |
---|
Hmmm... well this one isn't turning out to be so simple after all. The Unicode stuff is a little tricky the way CStrw and Cstr8 are created with the header file swap. Given that, I'm not sure how the best way to handle the unicode macros for iswspace and iswpunct (I need these for detecting unicode word boundaries). They aren't defined when you pull in CStr.h (only in CStr.cpp itself). Probably ought to put those in CStr.h. The real issue though is that I am not getting an event for ctrl-backspace in CInput. It is getting eaten up somewhere lower in the event chain. I guess I will have to go back and figure how the keystroke events are bubbled up into the event system so I can see why we aren't seeing ctrl-backspace.
comment:7 by , 13 years ago
Ok, figured out that the key combos needed to be defined as hotkeys in default.cfg and now I am getting the events. I just use the standard iswspace and iswpunct since CInput is always Unicode. So the rest should be easy :).
comment:8 by , 13 years ago
Cool :) As you can see it was I who added this ticket :) It's not all that important, but I do tend to press Ctrl+Backspace and wonder why nothing happens =)
by , 13 years ago
Attachment: | CInputEnhancementsAndFixes.patch added |
---|
comment:9 by , 13 years ago
Keywords: | review added; simple removed |
---|---|
Summary: | Make Ctrl+Backspace/Delete remove entire words in input controls → [PATCH] Make Ctrl+Backspace/Delete remove entire words in input controls |
I spent a lot time re-factoring and adding functionality to CInput since it seems we will be using it more and more.
Requested Enhancements
Added "Ctrl+Backspace" for delete word left Added "Ctrl+Delete" for delete word right
Additional Enhancements
Added "Ctrl+LeftArrow" for move word left (works with select if shift pressed) Added "Ctrl+RightArrow" for move word right (works with select if shift pressed)
Added mouse double click to select a word
Fixed bug in Clipboard code for Windows - now allows intra-application cut/paste Added "Ctrl+X" for Cut to clipboard Added "Ctrl+C" for Copy to clipboard Above bug fix also fixed problem with "Ctrl+V" paste
comment:11 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:12 by , 13 years ago
Milestone: | Backlog → Alpha 6 |
---|
comment:13 by , 8 years ago
Keywords: | review removed |
---|
The code for this is in
gui/CInput.cpp
,CInput::ManuallyHandleEvent
. It can be tested in e.g. the input controls in the multiplayer join/host setup screens.