Small puzzle: where is this focus-to-body action coming from?

52 views
Skip to first unread message

jkn

unread,
Mar 21, 2024, 10:33:33 AM3/21/24
to leo-editor
I keep meaning to look at 'improving' (for my needs) navigation between Tree and body panes. Whilst taking a look at this again I found a puzzle.

I have what is (I think) the standard bindings for this:

# show-commands
        Alt+d               focus-to-body
   tree:Tab                 focus-to-body
                            focus-to-find
                            focus-to-log
                            focus-to-minibuffer
                            focus-to-spell-tab
        Alt+t               focus-to-tree

However - CTRL+right (ie. main arrow keys on my 107-key KB) seems to do focus-to-body as well as TAB.

Any idea where this binding might be occurring? Is CTRL-right getting turned into TAB somewhere? How can I find out, if show-commands gives the output above?

Thanks, jon N


Thomas Passin

unread,
Mar 21, 2024, 1:28:09 PM3/21/24
to leo-editor
It's in LeoSettings.leo, in the node @shortcuts Gui operations.

jkn

unread,
Mar 21, 2024, 1:51:57 PM3/21/24
to leo-editor
I am not sure I even know what @shortcuts are! They are hardly mentioned in the docs.

Right, off to investigate, thanks...

jkn

unread,
Mar 21, 2024, 2:02:50 PM3/21/24
to leo-editor
^^^^ sorry, I should correct myself. I *do* know about shortcuts - I have forgotten that that was the name for the 'bind command to key' settings. I was thinking that was '@binding' or something.

Nevertheless - other @shortcuts I have in myLeoSettings.leo are shown in the log output to 'show-commands' - why not this one?

Or is it because this (Ctrl-right-arrow) is "Ctrl-Next"? This is shown in LeoSettings.leo and in the log pane:

tab-cycle-previous  = Ctrl-Prior
tab-cycle-next      = Ctrl-Next
tab-cycle-next      = Ctrl-Tab

? (I had never though of 'Ctrl-Next', and 'Ctrl-Prior', as referring to these key presses)

Great, in that case ... except that for me you can't *cycle* between the panes using this, only from tree to body. At least for me ... more investigation...

J^n

Jacob Peck

unread,
Mar 21, 2024, 2:11:03 PM3/21/24
to leo-e...@googlegroups.com
Seems to be defined in this node in the leoSettings.leo file shipped with devel:

unl:gnx://leoSettings.leo#ekr.20140721165014.19188 (line 88 of that node)

```
<...snip...>
enter-tree-expand-and-go-right-mode ! tree = Ctrl-RtArrow
<...snip...>
```

Jake

--
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 leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/0be80899-b9d8-4acc-afed-e50a74766276n%40googlegroups.com.

Thomas Passin

unread,
Mar 21, 2024, 2:21:02 PM3/21/24
to leo-editor
On Thursday, March 21, 2024 at 2:02:50 PM UTC-4 jkn wrote:
Nevertheless - other @shortcuts I have in myLeoSettings.leo are shown in the log output to 'show-commands' - why not this one?

It's in there. My listings for Settings/Show Settings /Show Commands has it:

        Alt+d               focus-to-body

It's hard to find things in these listings so I copied it and pasted it into a text editor.  A search for the command name located its line. Note that either a + or - symbol can be used for bindings, as best I know.

jkn

unread,
Mar 21, 2024, 3:20:19 PM3/21/24
to leo-editor
Yes, but that is for Alt-d, not the keystrokes I was mentioning.

I see the one that Jake mentions, above, but that seems to be for vi emulation, which AFAIK I do not have enabled. Anyway, that setting is within an @ignore node. At any rate, I do not have an entry for " enter-tree-expand-and-go-right-mode" from 'show-commands'

and I now want to know what keystrokes generate Ctrl-next and Ctrl-prior...

Jacob Peck

unread,
Mar 21, 2024, 4:07:57 PM3/21/24
to leo-e...@googlegroups.com
Oh wow, I completely missed the @ignore.

Curious, my machine does focus-to-body (or something similar, at least) on Ctrl+Right too, but I can't find any reason for that keybinding to be in place, nor does it show up in my 'show-commands' output either.  Only appears to work from the tree or log panes -- once in the body, forward-word happens instead (as intended).

I somehow doubt Ctrl+RightArrow equals the same keycode as Tab, because Ctrl+RightArrow acts differently from Tab in the body editor.

I wonder if this is some default tab-indexing thing in PyQT that we're not un-setting.  Maybe QT has Ctrl+(arrow keys) as default keybindings to navigate between widgets?

Ctrl+LeftArrow in either tree or log panes also seems to set focus to the body pane too.  When I 'float' the body pane (have it in a separate window), the behavior stops -- neither Ctrl+Right nor Ctrl+Left do anything in the tree pane any longer.

Weird!

Jake

--
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 leo-editor+...@googlegroups.com.

jkn

unread,
Mar 21, 2024, 4:42:33 PM3/21/24
to leo-editor
On Thursday, March 21, 2024 at 8:07:57 PM UTC gates...@gmail.com wrote:
Oh wow, I completely missed the @ignore.

Curious, my machine does focus-to-body (or something similar, at least) on Ctrl+Right too, but I can't find any reason for that keybinding to be in place, nor does it show up in my 'show-commands' output either.  Only appears to work from the tree or log panes -- once in the body, forward-word happens instead (as intended).


yes, that is the behaviour I see
 
I somehow doubt Ctrl+RightArrow equals the same keycode as Tab, because Ctrl+RightArrow acts differently from Tab in the body editor.

agreed
 
I wonder if this is some default tab-indexing thing in PyQT that we're not un-setting.  Maybe QT has Ctrl+(arrow keys) as default keybindings to navigate between widgets?

yes, I am wondering that too

FWIW I realised that 'Ctrl-Next' and 'Ctrl-Prior' refer to what would describe as "Ctrl-PgUp' and 'Ctrl-PgDn'.

This is all because I am hoping to implement something that *cycles* pane focus. One keystroke to move from tree->body->(maybe)log->tree-> ...

There are probably some gotchas to this, but I have a fixed pane payout...
Reply all
Reply to author
Forward
0 new messages