Switch between open windows in Pharo
Asked Answered
C

3

9

After search in the nautilus shortcut description:

enter image description here

I searched in the forums to find something about this, but doesn't work in Pharo v3.

I still looking for a shortcut that I can use to easily change between open windows such as alt + tab/cmd + tab in a SO.

Does anyone know how to do this?

Catadromous answered 26/7, 2013 at 16:5 Comment(1)
Nautilus is just a tool for browsing code, so what you get is logically a description of shortcuts local to this tool...Asis
A
6

It is work in progress. Right now, it seems that the key combination has not yet been decided/implemented.
When I explore the key mapping attached to the world,

World kmDispatcher explore.

I only see CMD+K reported as part of directKeymaps bound to [ self openAndCommitToMonticello ].
If I browse senders of openAndCommitToMonticello, I discover some incantation:

Komitter class>>initialize
    World 
        bindKeyCombination: $k command
        toAction: [ self openAndCommitToMonticello ]

Apparently, CMD+K must be understood as lowercase $k... (?)

The message for navigating thru windows is SystemWindow class>>sendTopWindowToBack (don't ask how I discoverd this...).
There are two senders

  1. the old keymapping infrastructure PasteUpMorph>>defaultDesktopCommandKeyTriplets
  2. A window menu (triggered by upper right down triangle) WorldState class>>windowsOn:

It seems the assigned key was \... So we can try and hook this key binding again.
Since it is rather not convenient on my French mac keyboard (CMD+\ means holding four keys !!!), I'll do it with right arrow.

If you look at KMSingleKeyCombination class>>specialKeys, you see that code for right arrow is 29.

So let's try this:

World 
    bindKeyCombination: 29 command
    toAction: [ System sendTopWindowToBack ].

Et voila, you get a new shortcut for navigating.

Asis answered 8/12, 2013 at 14:53 Comment(4)
Is almost perfect. In the last version (Pharo 3 betha) worsks for me use: [SystemWindow sendTopWindowToBack]. instead of: [ System sendTopWindowToBack ].Catadromous
Thanks, I got a working solution from this answer for making a global keyboard shortcut, though I don't understand why. When I inspect World, I don't see the method bindKeyCombination. Where is that defined?Accumulator
@Accumulator which Pharo version? Pharo is evolving fast. It is 7.0 nowadays...Asis
@Asis Sorry, yes, Pharo 7.0. However, I just looked again and see it is a method selector in Morph. Does that mean it only works as a global shortcut on any new windows opened after I set this? I.e. the event is handled by whatever Morph has focus, right?Accumulator
D
6

From Denis Kudriashov on the Pharo Slack,

https://github.com/juliendelplanque/Mirage

provides ergonomic support in Pharo 5.0.

Loadable from the Catalog.

Drainage answered 16/12, 2016 at 15:6 Comment(1)
This is absolutely great! I also confirm that it works with Pharo 5.0. Thanks! :)Nape
C
0

In Pharo 3.0 - Alt+tab works fine (continuously pressing it will keep flipping through windows, and pressing enter or space will select the displayed window)

Coleencolella answered 30/4, 2014 at 14:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.