Closed phcamargo23 closed 8 months ago
There is no way to solve this issue.
This issue is certainly solvable. I have gotten similar non-answers (#80, #81, #82, #83). Reading other issues, this seems to be a pattern with this developer. For a switcher without this issue, see cmdtab, of which I'm the author, after frankly being pissed by the responses I got here.
This problem cannot be completely solved.
If you press the key too quickly, the keystrokes at a certain moment may be detect as two keyevents: alt+tab
and alt
The alt+tab
will switch to the next app, alt
will activate menu, then a bug appeared.
I closed #81 #82 #83 because I didn't think it was necessary, This issue is closed because it cannot be resolved. This is no pattern.
If other people's open source projects cannot meet the demand, start a new project. I appreciate this behavior very much. I often do this myself.
As sigoden mentioned, clicking the Alt key on Windows defaults to focusing on the Menu or Tool bar.
In fact, many people have been troubled by this and have provided some excellent solutions. Moreover, many excellent software programs allow you to modify this behavior in the preferences settings. Please refer to the following link:
For vscode How to disable alt key to focus on File tab in VS code?
For SublimeText Disable ALT default key binding to toggle menu?
Additionally, using AutoHotkey can globally block/change this behavior.
@phcamargo23
Yeah; individually configure every app to workaround window-switcher
's limitations (and just live with the ones that can't be configured this way, like Chrome), or install a different app to perpetually run a script in the background to workaround window-switcher
's limitations...
Or use cmdtab which does the impossible /s and doesn't have this issue.
Yeah, now I remember why I got so pissed by these inane responses and made my own.
Your cmdtab don't have alt
problem, but does have tab
problem.
Using delay and discarding alt
key events did not completely solve the problem. @stianhoiland
I don't know what you mean by "tab
problem". Feel free to create an issue—I'm sure it can be fixed, and thus will be fixed, if it even exists.
And yes, the Alt key problem is solvable, as I've said and demonstrated. cmdtab's optional GUI delay has nothing to do with it. Correctly consuming and passing Alt key events is (and is part of a better approach to keyboard handling in cmdtab), as well as correctly using the SetForegroundWindow Alt key hack.
Repeatedly pressing alt+tab to switch windows quickly as described in the issue,window-switcher capture additional alt
keyevent (focus menu), cmdtab capture additional tab
keyevent (insert tab).
In cmdtab, quickly and repeatedly pressing Alt+Tab, Alt+Tab, Alt+Tab, or holding Alt and pressing Tab, Tab, Tab, does not produce any unexpected or unwanted additional Tab key events (and doesn't insert any additional tabs in text fields, nor selects next control).
Please create an issue, preferably with evidence and steps to reproduce, like @phcamargo23 took the time to do in this current issue. At this point I suspect you're just making shit up.
See the video. Repeatedly pressing alt+tab to switch windows quickly.
https://github.com/sigoden/window-switcher/assets/4012553/99932282-3cff-41c8-b287-34f4ff329552
You're fucking kidding me, right? I can see you being sloppy with pressing the keys, leading to you pressing Tab while you're not simultaneously holding Alt. Scumbag. To prove you're bullshit I made a AutoHotkey script that spams Alt+Tab 100 times while cmdtab is running and recorded it (video size reduced by frame dedup):
https://github.com/sigoden/window-switcher/assets/2081712/4246d218-f38d-47a3-bfac-8a9b715368d1
Not a single tab inserted. And not a single additional Alt key event.
Why tf am I still here. Apparently I didn't properly learn my lesson the first time I interacted with you. Please refrain from anymore false comments about cmdtab.
Why do you still not understand this issue? If you can keep alt+tab
being triggered at the same time every time, there will be no problem at all.
Use two fingers to quickly press the alt
key and the tab
key. When the speed becomes faster, the key presses at a certain moment may be detected as two key press events: (alt+tab
+alt
), ( alt+tab
+ tab
). That's why the bug occurs. @stianhoiland
When switching a window, focus is lost. From what you can see, it only happens that we change the window quickly. If you toggle smoothly, the focus remains, but if you do it quickly, it appears to trigger an automatic "alt" press, causing the focus to go to the toolbar.
https://github.com/sigoden/window-switcher/assets/5577637/3a3979af-5f90-4a43-ad95-e105cc1f83c4
My PC configurations is:
My file configurations is: