Wox: Refactoring Hotkey

Created on 4 Jan 2016  ·  17Comments  ·  Source: Wox-launcher/Wox

Related issue

  • [ ] Customized hotkey:

    • [ ] #460

    • [ ] #238

  • [ ] Double tap

    • [ ] #346 double tap

  • [ ] modifier keys + non modifier key

    • [ ] #984 win hook randommly not working

    • [x] #687 Ctrl+space

    • [x] #660

    • [x] #552

    • [x] #430

    • [x] #286 Win + ~ (buggy)

    • [x] #542 win+r

    • [x] #310 win

    • [x] #194

  • [ ] other:

    • [ ] #111 keep open??

    • [ ] #1306 don't trigger capslock

    • [ ] #1024

ideally there should be one solution

  1. have one single code base, not scattering around.
  2. can solve 90% of the existing hotkey issue.
  3. works on win7/8/10, win10 introduce more restriction
  4. plugin should not implement there own hotkey logic
big_changes

Most helpful comment

I suggest using hotkey ctrl + enter to run app as administrator.

All 17 comments

currently GlobalKeyboardEvent always returns true in my machien, which cause sometimes win+r is not intercept correctly...
but it returns correctly in other machines #690
strange....

https://github.com/Wox-launcher/Wox.Plugin.Switcheroo/issues/6 may also releated

LowLevelKeyboardProc:
- [ ] Win key hotkey will trigger windows start menu if you release win key (instead of non modifier key ) first
1. if we ignore key up event like [1.3.105], then it will cause https://github.com/Wox-launcher/Wox.Plugin.Switcheroo/issues/6#issuecomment-222382709
2. this also happens on alt key for firefox as reported here
https://github.com/Wox-launcher/Wox/issues/707#issuecomment-222361380

if 2 is a mistake, could we just ignore win key up event?

LowLevelKeyboardProc:

  • [x] when task manager is focused, hotkey won't be triggered.

this could be solved by use run as administrator
http://stackoverflow.com/questions/27335011/some-windows-in-windows-8-prevent-my-low-level-keyboard-hook-from-working

  • [ ] or could we use it if we sign the code?

e.g.
win+r won't works when task manager is focused for 1.3.67

I suggest reverting commit eeb8310 , as it introduced so many bugs without fixing any issue.
btw, I'm working on #703 , I have found the reason, and I'm trying to find a elegant solution

the solution in commit eeb8310 is the only way to handle all kinds of hotkeys, I can't find other ways...

I'm working on #703 , I have found the reason

what's the reason?

I'm not proficient in the way handle hotkeys in windows, but for me the way in version 1.3.100 works quite well, except #703 ( I'm close to fix this issue), while I didn't find any advantages (any case that 103 can handle but 100 cannot) ojf the way to handle hotkeys in 1.3.103.

advantage:
1 you can't use win key as wox hotkey
2 #346 wants to double tap one of the modifier keys... (not working now, but possible with current solution)

trigger时不光通过唤起wox后输入关键词,还能直接通过快捷键唤起(例如现在的cmd插件支持win+R。再举一个场景,这个功能配合一些词典类的plugin,就能够取代一些字典软件了)

3 ability to support this feature you mentioned

well, then we have no choice but fix these bugs step by step...

@jhdxr 试一下 114?

  1. win 键?
  2. firefox 中用 alt space ?
    https://ci.appveyor.com/project/happlebao/wox/build/1.3.114
  1. if we want to just use LowLevelKeyboardProc, then #706 won't be fixed even we use black magic code like AttachThreadInput (in win10)
  2. if we switch back to NHotkey which use RegisterHotkey. then #706 won't happen

    1. we need to use LowLevelKeyboardProc as a fallback method to handle win key

    2. could we use InputSimulator to send alt+space to get focus instead of call focus method directly? no, InputSimulator use virtual key, so wox won't get focus too.

there are so many code related, we need make an small app test ideas instead of refactoring wox directly....

how to disable registered hotkey
http://superuser.com/questions/129191/is-there-any-way-to-disable-certain-keyboard-shortcuts-in-windows-7

disable alt+tab

[HKEY_CURRENT_USERControl Panel\Desktop]
"CoolSwitch"="0"

  • [ ]
    if we could disable these hotkey programmatically by using registry,
    could we reuse these disabled hotkey then just use registerhotkey?
    instead of use force use lowlevelkeyboardproc.

👍 for this.

Win+Space would be nice to have

I suggest using hotkey ctrl + enter to run app as administrator.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

caoyue picture caoyue  ·  3Comments

xjl456852 picture xjl456852  ·  7Comments

andytham picture andytham  ·  4Comments

lgjmac picture lgjmac  ·  6Comments

sunshinenny picture sunshinenny  ·  4Comments