FreeSO icon indicating copy to clipboard operation
FreeSO copied to clipboard

#83 - adds shift+end/home and end/home functionality to InputManager

Open ssinakhot opened this issue 4 years ago • 1 comments
trafficstars

What was changed?

  • Adds the shift+end and shift+home functionality to the InputManager code
  • Adds the end and home functionality to bring cursor to beginning or end
  • Removed extra tabs from the ending portion of the long if-else statement to make it match up

How to test?

  • Type something in a text box and move the cursor to the center
  • Hit Shift+End to select everything from cursor to the end
  • Hit Shift+Home to select everything from start to cursor
  • Use End to move cursor to end
  • Use Home to move cursor to beginning

ssinakhot avatar Jul 09 '21 01:07 ssinakhot

A few issues, but I'm glad it's being added:

  • This breaks selecting text with shift and the arrow keys.
    • The other navigation keys go through UnhandledKeys to the UITextEdit. Check out UITextEdit:504 for the location where these keys are handled. It might be better to handle the new keys here, too, or at least allow the behaviour to follow through to here if shift is pressed with any other key.
  • Copy/Paste doesn't work correctly when selecting using shift+home (from the middle or end of the text edit), and selecting with non-shift home and end does not revert to a point selection. Be careful what you're doing with the selection start and end. Start must be before end, and a cursor with no selected characters should have the selection end as -1.

riperiperi avatar Jul 12 '21 22:07 riperiperi