juliendelplanque / Mirage

A windows switcher with a previewer for Pharo.
MIT License
34 stars 4 forks source link

Windows-like flipping #17

Open fuhrmanator opened 5 years ago

fuhrmanator commented 5 years ago

I tried Mirage finally and it is a big improvement. However, I was hoping to get it to work like Windows Alt-Tab (aka Flip) function which apparently is also in KDE, MacOS, iOS and Gnome.

First, I couldn't figure out how quickly to "go back to the last window I was in." The list of windows is absolute (rather than z-order), which seems to be part of the problem. Aha - I found the "World order" windows management setting.

As a use-case, I want to toggle between a Browser window and a Playground, because I'm copying/pasting bits of code. In Windows, you just hit "Alt-Tab-Tab (then release Alt)" and you can switch very quickly back and forth between two Windows. It's done with one hand.

In Mirage, there are many more keystrokes, and it also takes two hands:

  1. Ctrl-Tab (left hand, then you let go of Ctrl).
  2. Move (right hand) to arrow keys
  3. Press arrow keys until you find the window you want.
  4. Once you've highlighted the window, press return to select it.

So, I think it's basically asking for 1 thing to make it super ergonomic:

  1. Ctrl-Tab (or the key you configure) enters the switching mode, whereas releasing Ctrl exits it (maybe not possible in Pharo?). Successive Tab (or shift-Tab) without releasing Ctrl moves forward (or back) in the windows list.
macta commented 5 years ago

I can help with some of this - there is an option called World order windows managment, which gives that LRU ordering you want. I haven't managed to get ctrl-tab movement quite like you want, but when using the default key - shift-tab, tab, enter gives you a close proximity to ctrl-tab (albeit a few keys more).

juliendelplanque commented 5 years ago

I just hacked quickly and I am close to get a working prototype. Once I have it I will ask you to test the dev branch to see if it works for you. :-)

macta commented 5 years ago

That’s exciting - will definitely like to try it along with trying out the other fixes you’ve done

fuhrmanator commented 5 years ago

👍 I'm back on Monday from London, so looking forward to testing, tweaking, etc. I'm pharoless (without a PC to program) on vacation, as it should be.

On Thu, Apr 11, 2019, 07:44 Tim Mackinnon notifications@github.com wrote:

That’s exciting - will definitely like to try it along with trying out the other fixes you’ve done

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/juliendelplanque/Mirage/issues/17#issuecomment-481987471, or mute the thread https://github.com/notifications/unsubscribe-auth/AHQRDLRAzIM8B-Cz7CejH-HDkVlJgJ7Gks5vftnGgaJpZM4b4Hfp .

juliendelplanque commented 5 years ago

Ok, I just pushed on dev branch the prototype. So you can try it out by loading (it works in P7):

Metacello new
    repository: 'github://JulienDelplanque/Mirage:dev/src';
    baseline: 'Mirage';
    load

The problem is, because of Pharo limitation, it is hard to make parametrisable the key binding to close mirage. For now I hard-coded it to be when you release shift key. But to find the value I had to do some retro-engineering. I think the actual Keymapping project does not manage actions to be done when a key is released.

For now, I set the binding to Shift+Tab and as I said you can not change it anymore.

juliendelplanque commented 5 years ago

I discussed with Guille and apparently there is support for such key combination in Pharo. So I will find a way to make it configurable!

macta commented 5 years ago

Really appreciate you pushing on this one - anything to help make us more productive in Pharo is great.

If we can get it running smoothly - having a conversation around removing the old window switcher might be interesting. Not many even know it’s there, and it’s also very clunky

fuhrmanator commented 5 years ago

I tried the latest on :dev and it doesn't work well at all in Windows Subsystem for Linux (I'll try again in native windows soon):

fuhrmanator commented 5 years ago

For now, I set the binding to Shift+Tab and as I said you can not change it anymore.

In Windows and other Window managers, Shift is a convention for changing the direction of tabbing, i.e., Shift-Tab is a reverse-tab. It's what I meant in the first message:

Successive Tab (or shift-Tab) without releasing Ctrl moves forward (or back) in the windows list.

So, I was implying in my request that Shift be used by convention to specify a change of order on direction. I think if Shift-tab is allowed as the shortcut to activate Mirage, it would disallow leveraging of this convention to specify ergonomically reverse-tab. I'm hoping you can get something to work with Ctrl-Tab.

fuhrmanator commented 5 years ago

OK, @juliendelplanque, here's the Windows 10 feedback. It's definitely on the right track!

As @macta said, this is a great feature to help productivity. Let me know how else I can help you!

juliendelplanque commented 5 years ago

@fuhrmanator The thing is, I choose Shift+Tab as a shortcut because if I use Control or Meta, it usually clash with the windows switcher of the OS. (In fact I do not get the key event at all in that case).

So I think I will stick to Shift-Tab by default and to go in reverse way you can always use arrows.

What do you think?

fuhrmanator commented 5 years ago

To clarify, I was not suggesting it be Command (on MacOS) but Ctrl (they are two separate keys). On MacOS (as far as I know), it's Command-Tab to switch in the OS, right?

In Chrome, you can try on your Mac the combination of Ctrl-Tab to flip to the next Chrome tab. On my Windows 10 it works, and Shift-Ctrl-Tab flips to the tab to the left (reverse change).

Shift with tab is really a solid behavior in the GUI, for like 20 years at least. Changing that will likely alienate a lot of users. It is half the reason I wrote the feature request in the first place :-)

On Thu, 18 Apr 2019 at 21:08, Julien Delplanque notifications@github.com wrote:

@fuhrmanator https://github.com/fuhrmanator The thing is, I choose Shift+Tab as a shortcut because if I use Control or Meta, it usually clash with the windows switcher of the OS. (In fact I do not get the key event at all in that case).

So I think I will stick to Shift-Tab by default and to go in reverse way you can always use arrows.

What do you think?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/juliendelplanque/Mirage/issues/17#issuecomment-484646359, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2BCDFAR4KWEEBK652DEYLPRDBJPANCNFSM4G7AO7UQ .

-- Christopher Fuhrman, P.Eng., PhD

Professeur au Département de génie logiciel et des technologies de l'informationÉTS (École de technologie supérieure)

http://www.etsmtl.ca/ http://profs.etsmtl.ca/cfuhrman +1 514 396 8638 L'ÉTS est une constituante de l'Université du Québec Avis de confidentialité L'information contenue dans ce message électronique ainsi que dans les fichiers qui peuvent y être joints est de nature confidentielle et destinée à l'usage exclusif du destinataire. Si ce message vous est parvenu par erreur ou que vous n'êtes pas le destinataire visé, vous êtes par la présente avisé que tout usage, copie ou distribution de l'information contenue dans ce message est strictement interdit et vous êtes prié d'en aviser christopher.fuhrman@etsmtl.ca et de détruire ce message. Confidentiality Notice This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify christopher.fuhrman@etsmtl.ca. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

macta commented 9 months ago

As Mirage has sadly withered with subsequent versions of Pharo - just adding a note for anyone interested in Window's like flipping that I looked at what it would take to revive Mirage and decided that it was a bit more than I could realistically grok in an evening - but while doing so I understood enough about how to register a global keyboard shortcut and how there is a list of windows for the task toolbar and so I put those together into a simple project - https://github.com/macta/PharoFlipper which gives ^tab like behaviour via the ^1 shortcut. Its very basic and not as lovely as Mirage was, but hopefully it can help anyone else and maybe Mirage can be reborn.