Global keystroke captures being swallowed up by 1Password 8 Beta ?

wavded
wavded
Community Member

I use Hammerspoon to capture keystrokes. It appears sometimes I loose the ability to capture key down events but I can resolve the issue by shutting down 1Password 8 completely. I'm assuming this application is also watching for global keystrokes and perhaps those are not propagating to other apps all the time? I am using Monterrey and 1 Password 8 (latest beta) as well as latest Hammerspoon.

Hopefully this rings a bell with the developers as I'm unsure how to address on my side. If you need more information, I'd be happy to help.

Ref: https://www.hammerspoon.org


1Password Version: 8.4.0-19
Extension Version: Not Provided
OS Version: MacOS 12.0.1

Comments

  • wavded
    wavded
    Community Member
    edited October 2021

    Found some more information out that is interesting and is easily reproducible for me. If the 1Password 8 main window has focus, the key down events never get propagated down to Hammerspoon/OS. If I focus on another window, like Safari, they work again. Not sure if that is an issue with Electron. My guess is some combination of using 1P8 is causing this to fail all the time (even when the window is not in focus). Note, I also use Slack/Electron and it does not have the same issue.

  • This sounds like secure input blocking 3rd party keyboard listeners.

    1Password enables secure input when entering information into 1Password -- much like the system does for password fields.

    It's easy to introduce a bug where secure input is enabled but never disabled. If this happens, then quitting 1Password will restore normal input. Typically, we will only enable secure input when the 1Password window has keyboard focus.

    This will prevent some applications like TextExpander from working in 1Password. But it should not effect other "global keyboard shortcuts" in other applications.

    I'm not sure what mechanism hammerspoon is using, but it sounds like it's being blocked.

    Here is something you can do to test this assumption...

    Open Terminal.app
    From the Terminal menu, choose "Secure Keyboard Entry".

    Now try, your hammer spoon keystroke and see if it is blocked.

  • wavded
    wavded
    Community Member

    That is correct @chadseld . If I enable secure keyboard entry in Terminal I get the same behavior whenever Terminal has focus. I'll monitor this more closely to see if I can see what cases it seems to persist even when 1Password doesn't have focus.

  • wavded
    wavded
    Community Member

    @chadseld I did some more testing. I can get it to fail always, even if 1P8 doesn't have focus.

    From my testing I found a few interesting scenarios:

    Secure input (a.k.a. Hammerspoon not able to capture key events) seems to happen whenever any input is in focus on the main 1P8 UI. This is fine and desirable.

    Secure input does not seem to be enabled when using the Quick Access search box, which is interesting (bug possibly as it is enabled on the main UI search box?)

    I can still get 1P8 to enable secure input all the time even if 1P8 isn't in focus. I found these steps seem to always reproduce the issue for me:

    1. Quit 1Password
    2. Open 1Password and Enter Master Password
    3. Close 1Password Window using ⌘-W
    4. Right click on menu bar icon and select Quick Access
    5. Close Quick Access menu using escape key
    6. Right click on menu bar icon and select Open 1Password

    After this point I can no longer capture events even if 1Password is not in focus until I quit 1Password. Note, its weird, I have to use those specific ways of closing to reproduce. There probably are other ways, it seems the mix of quick access and the main 1password UI causes this state to happen.

    If you need any other details let me know!

  • Thank you for this detailed report. I can reproduce the issue too. I'll make sure we fix this. Excellent debugging!

This discussion has been closed.