-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Ctrl+X (cut) command and numpad navigation to text composition #23720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Ctrl+X (cut) command and numpad navigation to text composition #23720
Conversation
This feels a bit illogical to me. Typically, these shortcuts are used to navigate between fields. It seems what you're looking for is implementing [Home] and [End] key behaviour, no? CI is failing because |
Yes, Home and End sends the caret to the beginning and end of the current line but I'm a little more used to Ctrl+Up/Down to send the caret back and forth. Normally those are used to send it to the beginning of the next/previous paragraph, but since in RCT it's a single line text input they serve the same functions as Home and End, which is also common behavior. You can try it in inspect element, if you begin editing a random line of code and use these combinations it'll send the caret to the beginning/end of the line. There are some other software where they're used for switching between different UI elements (and in Firefox at least it serves as zoom in/out if the focus is not currently in a text field), but using them to move the caret is not exactly unusual.
Got it. 🙏 Edit: Oh wait, should I change that? I misunderstood what you meant at first 😅 |
I think it would be better if those things were just actual shortcuts which the user can configure to his choice. I don't mind it having it default to Ctrl+Up/Down but it shouldn't be hardcoded when we have a system to manage shortcuts. |
I've been thinking about this and I feel more and more the Ctrl+up/down shortcuts aren't that good of an idea in the end... In Firefox, if I click to edit this issue's title and use them they work fine, but if I try them in the search/address bar they already don't work. Honestly I was under the impression these combinations were universal, like Ctrl+C and Ctrl+V, but now I'm seeing they're actually very inconsistent, I just ended up growing very used to them while browsing with Firefox. I'm against adding making this remapable because we already have Home and End (I'm just not accustomed to using them lol), plus no other text box commands are remapable. I think I'll take them out and leave only the cut command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems alright, in the future its best to have renames in separate commits so its easier to see where the logical changes are.
Just to be sure, you mean making separate PRs? I was under the impression that blame just gave the PR where a certain line was changed, not the actual commit |
No, not a separate PR but separate commits, first commit could be "Implement X", second commit could be "Rename variables", it makes it easier to review code if we can just look at each commit and not the final resulting changes. |
@ZehMatt I know you've already reviewed this but I've been thinking of adding the numpad Delete key to the list of commands, so pressing it will have the same function as the already existing Delete. For some reason that idea didn't come to me until now. Would that be OK for you? |
You did it before I could answer, I'm not opposed of having the functionality but it would have been better for a separate PR to handle the numpad keys for navigation. Anyway, there should be some testing to make sure it works on all platforms as expected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works as expected on macOS 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cutting works as expected on Linux.
I have specifically not looked at the code or the discussion.
I think a changelog entry is also in order then its ready to go. |
@AaronVanGeffen Is this good? If so, I'll add a changelog entry and I think it's good to go, right? |
I think this got cut off by accident? It's been there ever since IntelOrca created this file in 2017
- Feature: [OpenRCT2#22905] Add diagonal downward-inclined brakes to hybrid coaster and single rail coaster. - Feature: [OpenRCT2#23759] Add see-through option to the “Cut-away View“. - Improved: [OpenRCT2#23677] Building new ride track now inherits the colour scheme from the previous piece. - Improved: [OpenRCT2#23720] Text fields now allow cutting to clipboard (Ctrl+X) in addition to copy and paste. - Improved: [OpenRCT2#23874] The load/save file browser window now uses icons for its action buttons. - Improved: [OpenRCT2#23875] Rides forbidden to be modified or destroyed can now be edited with the All destructible cheat. - Improved: [OpenRCT2#23879] Unique weather icons for snow, heavy snow and blizzard. - Fix: [OpenRCT2#1972, OpenRCT2#11679] Vehicles passing by toilets can cause them to glitch (original bug). - Fix: [OpenRCT2#9999, OpenRCT2#10000, OpenRCT2#10001, OpenRCT2#10002, OpenRCT2#10003] Truncated scenario strings when using Catalan, Czech, Japanese, Polish or Russian. - Fix: [OpenRCT2#14486] Guests will fall through upwards sloped paths when making their way through a park entrance or ride exit (original bug). - Fix: [OpenRCT2#15826, OpenRCT2#23835] Wooden Roller Coaster steep turn supports glitch when train goes over them (original bug). - Fix: [OpenRCT2#16357] Chairlift station covers draw incorrectly. - Fix: [OpenRCT2#16657] Mine Ride right S-bend uses Mini Roller Coaster sprite (original bug). - Fix: [OpenRCT2#18376] Ghost train gentle to flat track is not visible in tunnels. - Fix: [OpenRCT2#18389] Gentle sloped track pieces are not visible in low clearance height tunnels (original bug). - Fix: [OpenRCT2#18423] Underground Mini Golf holes can draw over land edges (original bug). - Fix: [OpenRCT2#18433] CJK TrueType fonts cannot be located when font names are translated by the OS. - Fix: [OpenRCT2#18436] Scenery on the same tile as steep to vertical track can draw over the track (original bug). - Fix: [OpenRCT2#18711] Park entrances with their sides underground can cause glitching. - Fix: [OpenRCT2#20848] Junior Roller Coaster booster track does not draw correctly in tunnels. - Fix: [OpenRCT2#20948] Incorrect diagonal brakes supports on the Giga Coaster, Looping Roller Coaster and Wooden Roller Coaster. - Fix: [OpenRCT2#21768] Dirty blocks debug overlay is rendered incorrectly on high DPI screens. - Fix: [OpenRCT2#22229] Opening a park save file from a newer version of OpenRCT2 yields an unhelpful error message. - Fix: [OpenRCT2#22617] Sloped Wooden and Side-Friction supports draw out of order when built directly above diagonal track pieces (original bug). - Fix: [OpenRCT2#22620] Mine Train Coaster trains glitch on large banked turns. - Fix: [OpenRCT2#23522] Diagonal sloped Steeplechase supports have glitched sprites at the base. - Fix: [OpenRCT2#23580] Table header labels may overlap if the window is made very small. - Fix: [OpenRCT2#23641] Steep to flat track is not drawn correctly in tunnels (original bug). - Fix: [OpenRCT2#23795] Looping Roller Coaster vertical loop supports are drawn incorrectly. - Fix: [OpenRCT2#23797] 3D Text cut off too early on multi-line signs. - Fix: [OpenRCT2#23809] Trains glitch on Bobsleigh Coaster small helixes. - Fix: [OpenRCT2#23811] Land edges glitch when vehicles go through gentle to flat tunnels. - Fix: [OpenRCT2#23814] Scenarios not indexed on first start. - Fix: [OpenRCT2#23818] Spinning tunnels can draw over sloped terrain in front of them. - Fix: [OpenRCT2#23828] Vehicles passing by station entrances and exits can cause them to glitch (original bug). - Fix: [OpenRCT2#23831] Hybrid Coaster large gentle banked right turns glitch when diagonal track is above them. - Fix: [OpenRCT2#23832] Hybrid Coaster large gentle banked left turns supports glitch as train passes. - Fix: [OpenRCT2#23836] Adjacent track can draw over large turns (original bug). - Fix: [OpenRCT2#23858] LSM launched lift hill has a misaligned sprite.
- Feature: [OpenRCT2#22905] Add diagonal downward-inclined brakes to hybrid coaster and single rail coaster. - Feature: [OpenRCT2#23759] Add see-through option to the “Cut-away View“. - Improved: [OpenRCT2#23677] Building new ride track now inherits the colour scheme from the previous piece. - Improved: [OpenRCT2#23720] Text fields now allow cutting to clipboard (Ctrl+X) in addition to copy and paste. - Improved: [OpenRCT2#23874] The load/save file browser window now uses icons for its action buttons. - Improved: [OpenRCT2#23875] Rides forbidden to be modified or destroyed can now be edited with the All destructible cheat. - Improved: [OpenRCT2#23879] Unique weather icons for snow, heavy snow and blizzard. - Fix: [OpenRCT2#1972, OpenRCT2#11679] Vehicles passing by toilets can cause them to glitch (original bug). - Fix: [OpenRCT2#9999, OpenRCT2#10000, OpenRCT2#10001, OpenRCT2#10002, OpenRCT2#10003] Truncated scenario strings when using Catalan, Czech, Japanese, Polish or Russian. - Fix: [OpenRCT2#14486] Guests will fall through upwards sloped paths when making their way through a park entrance or ride exit (original bug). - Fix: [OpenRCT2#15826, OpenRCT2#23835] Wooden Roller Coaster steep turn supports glitch when train goes over them (original bug). - Fix: [OpenRCT2#16357] Chairlift station covers draw incorrectly. - Fix: [OpenRCT2#16657] Mine Ride right S-bend uses Mini Roller Coaster sprite (original bug). - Fix: [OpenRCT2#18376] Ghost train gentle to flat track is not visible in tunnels. - Fix: [OpenRCT2#18389] Gentle sloped track pieces are not visible in low clearance height tunnels (original bug). - Fix: [OpenRCT2#18423] Underground Mini Golf holes can draw over land edges (original bug). - Fix: [OpenRCT2#18433] CJK TrueType fonts cannot be located when font names are translated by the OS. - Fix: [OpenRCT2#18436] Scenery on the same tile as steep to vertical track can draw over the track (original bug). - Fix: [OpenRCT2#18711] Park entrances with their sides underground can cause glitching. - Fix: [OpenRCT2#20848] Junior Roller Coaster booster track does not draw correctly in tunnels. - Fix: [OpenRCT2#20948] Incorrect diagonal brakes supports on the Giga Coaster, Looping Roller Coaster and Wooden Roller Coaster. - Fix: [OpenRCT2#21768] Dirty blocks debug overlay is rendered incorrectly on high DPI screens. - Fix: [OpenRCT2#22229] Opening a park save file from a newer version of OpenRCT2 yields an unhelpful error message. - Fix: [OpenRCT2#22617] Sloped Wooden and Side-Friction supports draw out of order when built directly above diagonal track pieces (original bug). - Fix: [OpenRCT2#22620] Mine Train Coaster trains glitch on large banked turns. - Fix: [OpenRCT2#23522] Diagonal sloped Steeplechase supports have glitched sprites at the base. - Fix: [OpenRCT2#23580] Table header labels may overlap if the window is made very small. - Fix: [OpenRCT2#23641] Steep to flat track is not drawn correctly in tunnels (original bug). - Fix: [OpenRCT2#23795] Looping Roller Coaster vertical loop supports are drawn incorrectly. - Fix: [OpenRCT2#23797] 3D Text cut off too early on multi-line signs. - Fix: [OpenRCT2#23809] Trains glitch on Bobsleigh Coaster small helixes. - Fix: [OpenRCT2#23811] Land edges glitch when vehicles go through gentle to flat tunnels. - Fix: [OpenRCT2#23814] Scenarios not indexed on first start. - Fix: [OpenRCT2#23818] Spinning tunnels can draw over sloped terrain in front of them. - Fix: [OpenRCT2#23828] Vehicles passing by station entrances and exits can cause them to glitch (original bug). - Fix: [OpenRCT2#23831] Hybrid Coaster large gentle banked right turns glitch when diagonal track is above them. - Fix: [OpenRCT2#23832] Hybrid Coaster large gentle banked left turns supports glitch as train passes. - Fix: [OpenRCT2#23836] Adjacent track can draw over large turns (original bug). - Fix: [OpenRCT2#23858] LSM launched lift hill has a misaligned sprite.
Ctrl+X will copy the text and clear the text box (up until this point it appears
Clear
was completely unused in this file).I also renamed
KEYBOARD_PRIMARY_MODIFIER
toKB_PRIMARY_MODIFIER
to make it a little less verbose. From what I can tell, it's not actually used inUiContext.cpp
, but I updated it there as well just in case.