Jump to content

Alfred doesn't disappear on certain entries when using Karabiner to press Escape


Recommended Posts

I'm using Caps Lock as Control via OSX preferences and I'm using Karabiner to make it so if I tap Left Control (or Caps Lock) and let go, it will instead send the Escape character.  This works for every application, and sometimes for Alfred.  If I type something random like "lakjflka", Alfred will display Search Google for "lakjflka".  I can then tap Left Control (or Caps Lock) and Alfred will disappear just as if I'd pressed Escape.  If I type a command (like "Restart"), and repeat, again, Alfred disappears no problem.  If, however, I type an application (like Chrome) and press Left Control (or Caps Lock), Alfred disappears ever so briefly, but then pops right back up with the same command still in the box.  If I eventually push the actual Escape key, Alfred will disappear.

 

I've made a screen recording of this happening here: 

Link to comment

I'm using Caps Lock as Control via OSX preferences and I'm using Karabiner to make it so if I tap Left Control (or Caps Lock) and let go, it will instead send the Escape character.  This works for every application, and sometimes for Alfred.  If I type something random like "lakjflka", Alfred will display Search Google for "lakjflka".  I can then tap Left Control (or Caps Lock) and Alfred will disappear just as if I'd pressed Escape.  If I type a command (like "Restart"), and repeat, again, Alfred disappears no problem.  If, however, I type an application (like Chrome) and press Left Control (or Caps Lock), Alfred disappears ever so briefly, but then pops right back up with the same command still in the box.  If I eventually push the actual Escape key, Alfred will disappear.

 

I've made a screen recording of this happening here: 

 

Hi Rick,

 

I'm moving this thread to the Discussion & Help to get more eyes on this thread, as fellow Alfred users will be able to help you with Karabiner. This isn't a bug with Alfred, as he works as expected  but possibly a misconfiguration in your key modifier app, as many Alfred users are happily using KeyRemap4MacBook (Karabiner's old name).

 

Cheers,

Vero

Link to comment
  • 2 months later...

It is definitely an Alfred issue.  The issue is Alfred catches as soon as you press Ctrl down to trigger the "Search with default web search" option.  This option is configurable on the Advanced tab of Alfred.  However, even if you set this to blank (do nothing), Ctrl is still being caught, so that when I release quickly and send Escape, somehow Alfred is not catching it.

Link to comment

It is definitely an Alfred issue.  The issue is Alfred catches as soon as you press Ctrl down to trigger the "Search with default web search" option.  This option is configurable on the Advanced tab of Alfred.  However, even if you set this to blank (do nothing), Ctrl is still being caught, so that when I release quickly and send Escape, somehow Alfred is not catching it.

 

It's not entirely clear what you are trying to achieve... In normal circumstances, Alfred will automatically hide after actioning so, e.g. if I open Alfred and type "Chrome" then press return, Alfred will hide himself and then launch Google Chrome.

 

The options you see in Alfred's Advanced preferences are for modifier keys and won't do anything by themselves, e.g. the ctrl modifier is ctrl+return to "Search with default web search", tapping ctrl by itself won't do anything.

 

Could you explain what you are trying to achieve, rather than what is happening?

Link to comment
  • 1 year later...

I'm experiencing the exact same problem, but with a different keyboard mapping utility. Alfred seems to be the common factor. Instead of Karabiner, I'm using Hammerspoon to remap my Control key (and therefore my Caps Lock key which I have remapped to Control via Apple's keyboard settings). It's mapped so that if I just tap Control, it acts as an Escape key. If I hold it down and use it as a modifier, it acts like a normal Control key. This is a fairly common remapping, which will likely see a lot more usage now that Apple's dropped the hard Escape key from the new MacBooks. The mapping command I'm using in Hammerspoon to send an Escape key when the Control key is pressed is: hs.eventtap.keyStroke({}, "ESCAPE"). This should look exactly like an Escape keypress to Alfred.

 

In Alfred (3.1.1), normally the Escape key will close any Alfred search/action window that's open, and my keyboard's hard Escape key still functions correctly with Alfred. However, the remapped Control key is usually recognized correctly by Alfred as Escape, but sometimes it is not. This appears to vary based on the Alfred function being performed. For example, if I open Alfred and type "33+33" to do some math, tapping Control is always correctly recognized by Alfred as Escape, and Alfred closes his window. Similarly, if I enter "empty" to start emptying the trash and then tap Control, Alfred correctly closes. However, anything involving file search doesn't work as expected, such as entering "pref" to open the System Preferences app, or "pict" to open the Pictures folder, or "in mike" to search inside of files. In those cases, pressing Control causes Alfred's results list to flash briefly and remain on the screen, instead of closing.

 

In Alfred's "Advanced" preferences I've changed "Ctrl+<enter> = Search with default web search" to a blank action, but this hasn't helped.

 

I realize this may not truly be an Alfred issue, and is more of an interaction problem between Alfred and keyboard remapping tools (two so far, Karabiner that RickA was using, and Hammerspoon that I'm using), but given the loss of the hard escape key in a couple weeks with the new MacBook Pro launch, I suspect keyboard remapping may become more popular.

 

Let me know if I can be of any assistance in troubleshooting, or if this is too esoteric a problem to look into for now.

 

Thanks!

Mike

Link to comment

Think I solved the issue for me. I suspect it'll help RickA and others who are having the same issue:

 

Although I disabled Alfred's <ctrl> modifier in the "Advanced" settings, I missed another default use of <ctrl> in the "Features" settings. Disabling <ctrl> in the Features -> File Search -> Actions -> Show Actions preference pane has made "ctrl as escape" work reliably for me! Screenshot attached.

 

Hope this helps others...

Mike

 

Screen Shot 2016-11-06 at 8.10.57 PM.jpg

Link to comment
  • 1 year later...

I was having the exact same issue.  The fix greenodg suggested worked for me! Thanks a ton gd.  I tweaked setting for a while and missed that one looking in Advanced and elsewhere.

But can someone please look into this as this is a workaround.  I have to assume that the Venn diagram of Mac power users, there's got to be a ton of overlap between karabiner and Alfred users.  and the Return to Ctrl (on hold is listed on one of the first Karbiner mods) https://pqrs.org/osx/karabiner/complex_modifications/#caps_and_return_to_ctrl-list-group

Link to comment
2 hours ago, JarrodCColburn said:

But can someone please look into this as this is a workaround

 

I think @greendog's fix is the workaround. If you have CTRL selected for "Show Actions" in Alfred, then you're going to have two apps monitoring the CTRL key for presses as a "normal" (i.e. non-modifier) key. If one of them (Karabiner) then starts firing off other simulated keypress events at the other app as a result, you're going to have problems.

 

It's not realistic to expect Alfred to be able to detect whether you've installed some other application that's hooking into the same mechanism and performing actions that interfere with Alfred. And let's be clear: Karabiner/Hammerspoon is interfering with Alfred in this case, not the other way around.

 

IMO, it ultimately has to be your job to ensure you don't have multiple apps applying special, conflicting behaviours to modifier keys at the same time.

Link to comment
  • 4 years later...

Sorry for bringing this up: but I think this is an important thread for every Karabiner (and potentially other remapping apps) users. In my case, I actually have both Karabiner and Hammerspoon working together and they work just fine except Alfred. 

Specifically, I'm using a HHKB keyboard, so the usual `Capslock` key location is already be set as `Ctrl` (in layer 1 to be specific). And for my case, I basically tell Karabiner to interpret a single click on `Ctrl` as `Esc`, while interpreting it as `Ctrl` itself if I'm holding on it. Everything works as expected except when I try to close Alfred while there is a searching result. Turns out that @greendog's solution works quite well, thanks a lot.

 

Edited by pbb
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...