Current state of shortcuts on macOS

81 views
Skip to first unread message

Karsten Wolf

unread,
Jun 13, 2018, 4:03:03 AM6/13/18
to leo-e...@googlegroups.com
macOS 10.12.6
Anaconda Python 2.7.12



I updated Leo just now and ran into two serious bugs and an annoyance..


Bug #1: One more modifier switch

Before the update on macOS the following mapping of modifier keys was true:

Leo - macOS

Alt = Alt
Ctrl = Command
Meta = Control
Shift = Shift

After the update:

Alt = Command
Ctrl = Alt
Meta = Control
Shift = Shift


Needless to say this rendered my shortcuts dangerous since most of them had editing actions I did not intend.





EDIT: This is only in the "devel" branch 

Bug #2: Doing a "Refresh from disk" works only once.

I created a @clean node, refreshed from disk and garbled it with hiccup #1. So I deleted and recreated the node "Refreshed from disk" and nothing happens. In my struggle with this issue where I made sure I don't save in this state, the empty file was somehow written to disk. I assume by "Edit in $editor" context menu.

After replacing the python file from a backup Leo finally did refresh.

To recreate:
1. create a @clean node to a python file
2. refresh from disk
3. delete the node
repeat steps 1 & 2.



EDIT: This is only in the "devel" branch 

- The annoyance

The python refresh code puts the filename into each function node. To me this is visually distracting because the first thing I see is the column of identical filenames.

Is there an option to turn this off?



vitalije

unread,
Jun 13, 2018, 5:18:51 AM6/13/18
to leo-editor

- The annoyance

The python refresh code puts the filename into each function node. To me this is visually distracting because the first thing I see is the column of identical filenames.

Is there an option to turn this off?


Try adding a node to your myLeoSettings.leo with the following headline:

@bool add-context-to-headlines = False

This setting has been recently changed in master to be by default False, but in devel it seems to be True by default.

I don't know about modifier names in macOS.

Vitalije

Edward K. Ream

unread,
Jun 13, 2018, 7:08:40 AM6/13/18
to leo-editor
On Wed, Jun 13, 2018 at 3:03 AM, 'Karsten Wolf' via leo-editor <leo-e...@googlegroups.com> wrote:

​> I updated Leo just now and ran into two serious bugs and an annoyance...​

​My apologies for the troubles you are having.

What version of Leo were you using previously, and what version of Leo are you using now?

Edward

Karsten Wolf

unread,
Jun 13, 2018, 8:46:53 AM6/13/18
to leo-editor
I am not sure which version I previously used. Some branch from mid april.

The "Refresh from disk" and the annoyance were from the current "devel" branch. Both worked fine on master.

The modifier switch bug is also in current master.


Edward K. Ream

unread,
Jun 19, 2018, 7:26:52 AM6/19/18
to leo-editor

On Wed, Jun 13, 2018 at 7:46 AM, 'Karsten Wolf' via leo-editor <leo-e...@googlegroups.com> wrote:


I am not sure which version I previously used. Some branch from mid april.

​There has been a lot of key-related work since then.

What value of @bool swap_mac_keys do you use?

Edward




Edward K. Ream

unread,
Jun 19, 2018, 7:32:58 AM6/19/18
to leo-editor
On Tue, Jun 19, 2018 at 6:26 AM, Edward K. Ream <edre...@gmail.com> wrote:
What value of
​​
​​
@bool swap_mac_keys do you use?

​A big oops.  This setting is no longer used, though an (unused) ivar is inited.​

Am I correct in assuming that you use
@bool swap_mac_keys = True?

This is a serious bug.  I have just created #930 for it.  I'll fix it next.

Edward


Karsten Wolf

unread,
Jun 19, 2018, 8:34:45 AM6/19/18
to leo-e...@googlegroups.com

> On 19. Jun 2018, at 13:32, Edward K. Ream <edre...@gmail.com> wrote:
>
> On Tue, Jun 19, 2018 at 6:26 AM, Edward K. Ream <edre...@gmail.com> wrote:
>
> What value of ​​​​@bool swap_mac_keys do you use?
>
> ​A big oops. This setting is no longer used, though an (unused) ivar is inited.​
>
> Am I correct in assuming that you use ​@bool swap_mac_keys = True?

No. But I'm using https://github.com/karstenw/leo-shortcuts-osx


swap_mac_keys does not appear in Settings -> Show Settings -> List all Settings


BTW, I switched back to 5.7.2.

-karsten

Edward K. Ream

unread,
Jun 19, 2018, 11:41:31 AM6/19/18
to leo-editor
On Wednesday, June 13, 2018 at 3:03:03 AM UTC-5, Karsten Wolf wrote:


Before the update on macOS the following mapping of modifier keys was true:

Leo - macOS

Alt = Alt
Ctrl = Command
Meta = Control
Shift = Shift

After the update:

Alt = Command
Ctrl = Alt
Meta = Control
Shift = Shift

There are two settings, at least, that affect key bindings on MacOS:

@bool swap_mac_keys = False
@bool replace-meta-with-alt=True

What values for these settings do you use?

With the settings shown, everything works as expected with a Microsoft keyboard. With an Apple (chicklet, US) keyboard, the Alt (Option) key generates keys directly, so there is no way to catch Alt- modifiers.

With the Apple keyboard, The Control key generates the Alt- modifier, and Command (clover) key generates the Ctrl- modifier.

Recent revs add support for @bool swap_mac_keys = True, but that has not been recommended for years, iirc.

HTH.  I plan no further work on #930, but I'll be happy to fix any remaining problems.  Please use --trace-keys when reporting what is happening.

Edward

Karsten Wolf

unread,
Jun 20, 2018, 7:35:57 AM6/20/18
to leo-editor


On Tuesday, June 19, 2018 at 5:41:31 PM UTC+2, Edward K. Ream wrote:
On Wednesday, June 13, 2018 at 3:03:03 AM UTC-5, Karsten Wolf wrote:


Before the update on macOS the following mapping of modifier keys was true:

Leo - macOS

Alt = Alt
Ctrl = Command
Meta = Control
Shift = Shift

After the update:

Alt = Command
Ctrl = Alt
Meta = Control
Shift = Shift

There are two settings, at least, that affect key bindings on MacOS:

@bool swap_mac_keys = False
@bool replace-meta-with-alt=True

What values for these settings do you use?

I use the defaults from leoSettings.leo:

    @bool   replacemetawithalt = False
    @bool   swapmackeys = False


With these settings and branch master:

Alt-Left, which I defined in myLeoSettings, like all Mac-Editors, as back-word.

trace-keys:

LeoKeyEvent: binding: Alt+KeyPad+Left, stroke: <KeyStroke: 'Alt+Keypad+Left'>, char: u'Left'
masterKeyHandler u'Left' <KeyStroke: 'Alt+Keypad+Left'>
 
action taken: focus on tree and select parent node

It gets the key and executes something different.

In Settings:
M  all: Alt+Left      back-word

 

With the settings shown, everything works as expected with a Microsoft keyboard. With an Apple (chicklet, US) keyboard, the Alt (Option) key generates keys directly, so there is no way to catch Alt- modifiers.

My keyboard is a Logitech K120  https://www.logitech.com/en-us/product/k120 - german layout.

Edward K. Ream

unread,
Jul 5, 2018, 12:07:50 PM7/5/18
to leo-editor
On Wed, Jun 20, 2018 at 6:35 AM, 'Karsten Wolf' via leo-editor <leo-e...@googlegroups.com> wrote:


On Tuesday, June 19, 2018 at 5:41:31 PM UTC+2, Edward K. Ream wrote:
On Wednesday, June 13, 2018 at 3:03:03 AM UTC-5, Karsten Wolf wrote:


Before the update on macOS the following mapping of modifier keys was true:

Leo - macOS

Alt = Alt
Ctrl = Command
Meta = Control
Shift = Shift

After the update:

Alt = Command
Ctrl = Alt
Meta = Control
Shift = Shift

​I can understand your frustration, but I see no such switch on my machine.

When all else fails, I suggest modifying the settings in myLeoSettings.leo so that they work.  I don't know what else to suggest.

Edward

Edward K. Ream

unread,
Jul 5, 2018, 12:10:18 PM7/5/18
to leo-editor
On Thu, Jul 5, 2018 at 11:07 AM, Edward K. Ream <edre...@gmail.com> wrote:

​I can understand your frustration, but I see no such switch on my machine.

When all else fails, I suggest modifying the settings in myLeoSettings.leo so that they work.  I don't know what else to suggest.

#930 says the following:

Rev 7d450ba appears to work as expected on MacOS with a Microsoft keyboard with the following settings:

@bool swap_mac_keys = False
@bool replace-meta-with-alt=True
I am going to close this issue.

Edward
Reply all
Reply to author
Forward
0 new messages