medley icon indicating copy to clipboard operation
medley copied to clipboard

Keyaction for forward-delete

Open rmkaplan opened this issue 2 years ago • 1 comments

I'm ready to bind the forward-delete key (on my extended Mac keyboard=function-delete on my macbook) to the TEDIT char-delete-forward action. We've talked about this at some length, now I want to pin it down.

Currently, that key sets bit 13 in the keyboard bit vector, with historical key-cap names (\ | FONT LOOKS)

The standard keyaction table translates this to character codes ^W (unshifted) and ^U (shifted).

Tedit and TTYIN both currently interpret ^W as backward-word-delete. Thus the forward-delete key is just an abbreviated way of invoking that action. ^U appears to be line-delete for TTYIN, but currently not for Tedit--could also be done.

It seems reasonable for word-delete to continue to be triggered by ^W, but more intuitive to repurpose the forward-delete for forward-char-delete.

So I propose changing the default mapping in LLKEY for bit 13 so that it produces a code different from ^W. Presumably unused code in the Meta ( currently 256-511) or Function (currently 512-767) ranges. Does it matter what we choose, as long as it is currently unused?

The shifted version could also map to something other than ^U, or it could remain as a line-delete synonym.

(Separately, Function and Meta would have to be mapped to somewhere else in the character code space if we go to Unicode internally, per John Cowan's earlier suggestion).

(Also I think Nick posted a link in one of the chats to an earlier discussion surrounding the Meta/Function character sets, I can't find it now.)

rmkaplan avatar Dec 24 '23 20:12 rmkaplan

The strategy of fixing the key mapping one key at a time without a better idea of where we're going seems to me that it will likely result in a lot of false starts and revisions. As an experiment to be separately loaded it's fine. Put the functionality in the release -- excellent. But some keystrokes will have to be redefined to reach the goal. And the 'delete' and 'move caret' functions dont currently match.

I think most Unix and Mac and Windows users today are used to the "Backspace" character being "delete selection (if there is one) otherwise backward character delte, and the "Delete" character being "delete selection (if there is one) otherwise forward character delete.

And the "control" key ("command on Mac") modifying these to do more: cntl-backspace delete backward word, cntrl-delete doing forward-delete-word. While at it, make left-arrow right-arrow up-arrow down-arrow equivalent to control characters with shift moving rurhter. I think cntrl (meta on mac) would then give enhanced movement possibilities.

masinter avatar Dec 24 '23 22:12 masinter