This will be pre-writing for an enhancement proposal.

I've been immersed in curses key handling recently, and it has given me new 
ideas about key handling.  This post discusses the settings used in  
@shortcuts nodes. Another post will discuss possible changes to how Leo 
handles keys internally.

I propose deprecating Tk names and the shift modifier from keyboard 
settings. Don't panic: Leo will support both indefinitely, but will 
(optionally?) suggest preferred settings.

*Tk names*

At present, Leo's settings support (require?) Tk names like "ampersand" 
instead of "&". I see now that this has never been required. Doh, Leo could 
have done the translation behind the scenes.  Clearly, we would prefer:

   some-command = Ctrl-&

to:

    some-command = Ctrl-ampersand

*The shift modifier*

The following are new thoughts that appeared when I awoke this morning. The 
shift modifier causes Leo troubles both when handling settings and when 
dealing with key codes from the keyboard. These troubles arise because 
different keyboards have different shifted keys.

Another Aha/Doh moment: the user should be able to describe the keyboard, 
say with *@data keyboard*.  It would consist of a list of pairs 
unshifted/shifted pairs.  There would be no need to specify pairs for the 
letters a-z.  For example, for my keyboard:

    @data keyboard
    1 !
    2 @
    3 #
    4 $
    5 %
    6 ^
    7 &
    8 *
    9 (
    0 )
    - _
    = +
    [ {
    ] ]
    \ }
    ; :
    ' "
    , <
    . >
    / ?

Other keyboards will be different.  There is no reason why any of these 
characters shouldn't be non-ascii (unicode) characters. Perhaps even 
Chinese characters. The resulting *shift table* would likely simplify Leo's 
code internally, although only time will tell how much.

In any case, given the shift table, Leo will ask the user to specify

    some-command = Ctrl-<

rather than either of these:

    some-command = Ctrl-Shift-.
    some-command = Ctrl-Shift-period

Leo will continue to allow the usual variations in settings:

    some-command = Control->
    some-command = Ctrl->
    some-command = Control+>
    some-command = Ctrl+>
    etc.

Your comments, please.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to