Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow shortcut to be a mouse key #641

Closed
Adhyyan1252 opened this issue Oct 8, 2020 · 12 comments
Closed

Allow shortcut to be a mouse key #641

Adhyyan1252 opened this issue Oct 8, 2020 · 12 comments
Labels
enhancement New feature or request niche Nice idea, but not enough demand for it

Comments

@Adhyyan1252
Copy link

I am a user who just switched from windows and previously i had configured my mouse side buttons to be used for alt-tabbing. Clicking mouse-button-4 would open the switcher and proceed the selection by one. quickly releasing and pressing it again would proceed it one more. and if you leave it for long enough it would go to the selected window. worked like a charm on windows and saved me a ton of time.

@Adhyyan1252 Adhyyan1252 added the enhancement New feature or request label Oct 8, 2020
@lwouis
Copy link
Owner

lwouis commented Oct 9, 2020

Hi @Adhyyan1252!

I'm not sure I understand the flow you describe. On Windows, as soon as you release alt, the switcher goes away, which is not friendly to mouse-binds since usually people will bind mouse buttons to keyboard keys, like in your case I assume you bound alt+tab to mouse4. And that would mean that pressing mouse4 triggers a press of alt and tab, then releasing mouse4 triggers the release of alt and tab. At this point I expect the switcher to disappear, not giving you a chance to cycle to the next window. Maybe you had a special feature on your mouse where the vendor implemented some scripting to manipulate alt-tab specifically on Windows? I know this exist. How are you binding mouse4? To keyboard inputs, or some special vendor-specific action?

Also I'm not sure I understand what you would like to see in AltTab. You explained your previous workflow, but didn't formulate any enhancement that you would like to see in AltTab. This is why I added a template to the ticket by the way. You have emptied the template, but there is a reason I added it 😅 Can you please clarify what you would like to see improved?

In any case, I can tell you that people have already asked to have a mouse-friendly UX, and I added that in AltTab. In the preferences, you can change the shortcuts to not hide the UI on release:

image

This makes it easy to bind mouse buttons to alt+tab to summon the UI, then you can just click on the window you like. You can also press the shortcut again while the UI is open which will move to the next window. You can bind another mouse shortcut like mouse5 if you want to select the window without clicking it.

image

You could also bind mouse4 down to alt-tab down and mouse4 up to Space press to use only 1 mouse button.

Basically you can be creative as there are many workflows possible with AltTab, with keyboard and mouse. If you're satisfied with the workflows I described, please feel free to close the ticket. Otherwise, please elaborate on what you think would be a way to improve on the mouse workflow.

@Adhyyan1252
Copy link
Author

Sorry for not being completely clear before. I know of 2 applications which implemented specific functionality for alt-tab in their mouse. The first one is the logitech mouse and the logitech-options windows app which comes along with it. Then there's the XMouse control app for windows which has an option to make one of your mouse buttons a switcher. Essentially, I would like to see an enhancement in altTab which would allow me to do this.

It's best to install xMouseControl and test it out yourself because only then will the convenience be really seen. Ill give my shot at explaining it here:

Instead of having 2 buttons doing the switching (which is by default ALT and TAB) you only have one button doing the switching. Let the button be B. If B is pressed for the first time, the switcher opens and it stays open as long as B is being pressed. If B gets released and then within a set time period(say 100 ms) gets pressed again the switcher selection moves one ahead. Finally when B is released for a long time, the application is changed to the selected switcher and the switcher disappears.

Even though I mainly use the keyboard for most of my activities, I still find using the mouse to switch using this technique more convenient and in some cases faster.

This button B can either be a keyboard button or a mouse button.

@Adhyyan1252
Copy link
Author

Adhyyan1252 commented Oct 9, 2020

This could have several advantages. For eg. users can make their right-shift button (or any other free button) to an alt-tab button. Also people not might be creative enough to think about applying different configs for mouse up and down (i didn't think of that) so this could help them.

An easy way to implement this:
In the alt-tab preferences, allow users to select the hold key (option) and press key(tab) to be configured to the same button. And in the "release" allow options to be {do nothing, Focus selected window, focus selected window after 300 ms and keep the switcher on in the meanwhile). This effectively produces the same result. If this didn't make sense, lmk and I can give it another shot.

Would also have to give an additional option such that when you are holding the press key(tab), the switcher only moves forward once. So the selector should only move "on click" and not "while clicked"

@lwouis
Copy link
Owner

lwouis commented Oct 9, 2020

I understand now, thank you for the more detailed explanations.

What I'm a bit puzzled by is: if your hand is already on the mouse, then why not use the mouse to select and click on the thumbnail? That seems more appropriate than hitting mouse4 multiple times to move 1 by 1 to the window you want. Also how do you go back if you went one-too-many presses? And how do you cancel if you change your mind? Also you have 300ms to locate the window before it select the current one right? That's really short.

All those problems go away if you use the actual mouse by clicking the window you want, anywhere on the list, or clicking outside of the list to cancel.

This UX you describe, with 300ms to press the button again to "hop" 1 by 1 seems limited and slow to me. Like if you want to go back to the previous window, without seeing the list even, because you just left it so you know what you want, then with this UX, you would wait 300ms to activate. You could directly bind alt+tab to the mouse and get an instant switch instead, and bind the other shortcut (Shortcut 2 in the preferences) to "Do nothing" and have the more flexible flow where you can mouse4 and then you can release it and have as much time as needed to locate the window you want and click on it, or click away to cancel.

To summarize, here are the weaknesses I perceive in this workflow:

  • Can't cycle backwards
  • Can't cancel
  • 300ms latency to focus
  • User has to be really fast to identify window, and only has 300ms increments to locate it

What do you think about this?

@Adhyyan1252
Copy link
Author

Also you have 300ms to locate the window before it select the current one right? That's really short.
User has to be really fast to identify window, and only has 300ms increments to locate it

No. If the button is held down, the switcher remains static. The window only comes on focus when you leave the button for 300 ms.

Can't cancel

For cancelling there can be workarounds i guess. Maybe if you click outside the switcher while holding the button, it would cancel it.

300ms latency to focus
Can't cycle backwards
Yes, these are good points.

As I think more about this, I do see that it might not be the most practical/efficient. Although a good implementation would definitely be cool and have the potential to make it efficient  and could have utility.

@lwouis
Copy link
Owner

lwouis commented Oct 9, 2020

To implement that workflow, it would require 2 new preferences as you described above. I don't think there is a need to combine the shortcuts into 1 as you mentioned.

My philosophy for enhancements is that it's ok to add complexity (the 2 new preferences) as long as it delivers value to the users.

So this enhancement needs to bring more value than the existing mouse workflow to outweight its UX complexity cost. I haven't heard such arguments from you so far.

To me this flow has the mouse operate as a keyboard: instead of moving it and selecting visually, only the keys are pressed and the mouse is static.

I'll keep this ticket open to see if other people show interest in such a workflow. For now i think we need a stronger case to justify added yet more preferences and complexity, as well as the pragmatic reality of my time being limited and there being 48 other issues to work on at the moment

@chavlji
Copy link

chavlji commented Oct 24, 2020

@Adhyyan1252 you can use Hammerspoon for such customizations.

I've mine set so that doing mouse wheel while holding x2 mouse button, brings up alt-tab and when I release x2 it focuses the selected app. It works like a charm, but I tend to use the keyboard as much as I can lately. It's a lot faster...

Maybe a bit steep learning curve, but it's definitely worth it!

@KurtGokhan
Copy link

In Windows you can close windows in alt-tab by middle click. Only now I realized how much I miss that feature. It will be possible if I can assign middle-click instead of Q to the quit shortcut.

@lwouis
Copy link
Owner

lwouis commented Feb 24, 2021

@KurtGokhan The idea of implementing middle-click to close like on Windows (I had no idea, thanks for sharing that trick!) is interesting. We could actually let users bind any mouse button to these:

image

We could have a second column of bindings. By default, the Focus selected window command would have Space and Mouse left-button. We could have Close window have W and Mouse middle-button. Maybe Minimize/Deminimize window have M and Mouse right-button.

There are 2 issues with implementing this idea:

  • Added complexity: now users open the Controls preferences, and it's even more complex than currently. It's already way too complex I would argue (see Simplifying the preferences UI #351)
  • Supporting mouse buttons: I use ShortcutRecorder to handle recording custom shortcuts. It's extremely complex, and I'm glad this library is handling this for me. I'm not sure another library exists to record mouse buttons. Imagine for instance gaming mouses with 10 buttons.
  • Should we let users bind scroll up/down? Scrolling is already scrolling the view when there are lots of windows shown. That's going to conflict.

Regarding the last 2 points, a way to handle it could be to only support mouse left, middle, and right buttons. That way I hardcode a dropdown with 3 options and we are done.

It would also be nice to implement #832 since the user could easily bind the same mouse button to multiple shortcuts by mistake.

Something else to think about is that we could go deeper and support even more triggers. See for instance what BTT supports:

image

@KurtGokhan
Copy link

KurtGokhan commented Feb 24, 2021

@lwouis thanks for replying. Regardless of any missing features, this is a great app as is. I suggested something without realizing how complex it is. I just wanted to present an additional use case if this is ever implemented. So, no pressure. Also sometimes less is more.

@lwouis
Copy link
Owner

lwouis commented Feb 24, 2021

Another way we could do it is instead of:

  • Keyboard shortcut or Mouse button Action 1
  • Keyboard shortcut or Mouse button Action 2
  • Keyboard shortcut or Mouse button Action 3

We could do the other way around, and have another section after the actions, which reads:

  • Mouse left-button Dropdown with possible actions
  • Mouse middle-button Dropdown with possible actions
  • Mouse right-button Dropdown with possible actions

I'm throwing this alternative out there because it may be nice to have a section dedicated to mouse and/or trackpad since we already cover:

  • Mouse hover
  • Mouse left-click
  • Mouse scroll

And we may support in the future:

  • Mouse middle-click
  • Mouse right-click
  • Trackpad/mouse omni-directional scroll (see Support 3-finger scroll to navigate the thumbnails #730)
  • Maybe activating AltTab through trackpad gesture like 3-fingers
  • Maybe activating AltTab through complex mouse gesture like middle-click + move the mouse left/right

@lwouis
Copy link
Owner

lwouis commented Apr 28, 2022

I think this is better handled with mapping some input to the keyboard shortcut, as I discussed above. Furthermore, I think this feature request is quite niche, so I'll close this ticket for now. Please upvote if you're interested in this feature. Enough upvotes and I'll reopen the ticket 👍

@lwouis lwouis closed this as completed Apr 28, 2022
@lwouis lwouis added the niche Nice idea, but not enough demand for it label Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request niche Nice idea, but not enough demand for it
Projects
None yet
Development

No branches or pull requests

4 participants