Wox.Plugin.Switcheroo
Wox.Plugin.Switcheroo copied to clipboard
Wox does not get focused on Alt+Tab
As of 1.0.6, still, while the Alt+Tab hotkey is overriden and Wox is shown, the focus is not on Wox's input field.
try 1.3.109 https://ci.appveyor.com/project/happlebao/wox/build/1.3.109 hotkey has been rewrite. you cann assign alt+tab in hotkey tab in settings.
I will test more extensively this week on a real Windows installation.
So far, in the VM when I set the hotkey to Alt+Tab it reacts to the first one correctly, but sequential presses of tab get recognized as Alt+Tab. Cannot confirm if this is a VM issue or not at this point.
but sequential presses of tab get recognized as Alt+Tab.
could you try 1.3.103 to test this problem? https://ci.appveyor.com/project/happlebao/wox/build/1.3.103/artifacts
1.3.103 has the same issue as all the versions before 109: on pressing Alt+Tab Wox is shown, but does not get focused.
how about 114...? https://ci.appveyor.com/project/happlebao/wox/build/1.3.114
do you have this problem in release version v1.3.67 ?
@happlebao Builds 114, 122 have the same issue. Wox is shown, but not focused.
In build 1.3.67 upon launching Wox with the hotkey set to Alt+Tab I'm notified that the hotkey could not be set. If build 1.3.67 is using NHotkey to register the Alt+Tab hotkey it will not work, because NHotkey tries to register a new system-wide hotkey and not adding a hook to the chain of calls.
- what I mean is use 1.3.67 with replace alt+tab option in switcheroo plugin option. could you get focus?
- and if you use above setting and 1.3.67. will this line be called?
- if you use 1.3.67 and alt+tab can't get focus, will win+r (shell plugin) get focus ?
methods to register/hook alt+tab
lowlevelkeyboardhook:- won't get focus if start menu is open
- won't be called at all if task manager is focused (can be fixed by run as admin)
RegisterHotkey: MS claims that we can register alt+tab from XP. as seen here. but this not working in win10, even run as admin.- disable it in registry: the following entry is not showing in win10, and it has no effect if I add it manually
[HKEY_CURRENT_USER\Control Panel\Desktop]
"CoolSwitch"="0"
how other applications doing
- switcheroo is using
lowlevelkeyboardhookfor alt+tab, because this hotkey won't working if task manager is focused - vistaswitcher is not working from win8, so I guess it use
RegisterHotkey
I can't find any working method or working application now. let me know if you have more ideas.
Sorry for the delays between answers, I am a little busy with finals.
I think the way to go is to keep using the low-level hook, but also add the functionality to be able to focus the Wox window also on a low-level. What do you think?
Also, on a separate topic, I recently found GoToWindow and I think Switcheroo could be eventually replaced by it. While both projects (Switcheroo&GotoWindow) are not in active development, GoToWindow has some interesting functionality (as jumping to specific browser tabs).
@lances101 could take a look about these questions? https://github.com/Wox-launcher/Wox.Plugin.Switcheroo/issues/6#issuecomment-222807608
- With 1.3.67 when I enable the Switcheroo setting I still get no focus in most cases. A weird thing that does happen is that after attaching the debugger the bug seems to be "fixed" and Wox is always focused.
- It is not called.
state.AltPressedreturns false even though it's true. I cannot debug it with a debugger, because once I attach it always fires correctly. - Win+R is detected just fine
Edit: Added some simple logging to see what is actually happening since I can't debug it.
2016-06-04 18:57:28.3590|INFO|Wox.Plugin.Switcheroo.Plugin.API_GlobalKeyboardEvent|EVENT KE-260, VK-9, Alt-True
2016-06-04 18:57:28.3590|INFO|Wox.Plugin.Switcheroo.Plugin.API_GlobalKeyboardEvent|Key down handled, should exit.
2016-06-04 18:57:28.3719|INFO|Wox.Plugin.Switcheroo.Plugin.API_GlobalKeyboardEvent|EVENT KE-261, VK-9, Alt-True
2016-06-04 18:57:28.3719|INFO|Wox.Plugin.Switcheroo.Plugin.API_GlobalKeyboardEvent|Key up handled, should exit.
2016-06-04 18:57:28.9750|INFO|Wox.Plugin.Switcheroo.Plugin.API_GlobalKeyboardEvent|EVENT KE-257, VK-164, Alt-True
2016-06-04 18:57:28.9750|INFO|Wox.Plugin.Switcheroo.Plugin.API_GlobalKeyboardEvent|We are letting ALT tab pass - KE-257, VK-164, Alt-True
The key_up (260) and key_down (261) events are watched and the function returns false, but then it fires once more and returns true.
could you get focus when using switcheroo (alt tab enabled)?
All of what I said in my last comment is related to 1.3.67 with Alt+Tab in Switcheroo enabled.
I know. But is switcheroo is working, we can just copy their code ....
I took a look at their code now. It seems like they had the same problem. Take a look at the comment here
https://github.com/Wox-launcher/Wox.Plugin.Switcheroo/commit/e92367a3005abdeff43f380c1ab7a59d5cd1063a seems to have fixed the issue. I've tested on several machines and it seems to work as expected now.
I tested 1.0.7, alt+tab did not work for me. Windows 10 10586 X64