Jump to content

Alfred interpreting Keyboard Maestro key presses wrongly?!


Januz
 Share

Recommended Posts

Hi,

 

I defined several keyboard shortcuts in Keyboard Maestro, among others I use ctrl-j/ctrl-k/... (aka vim movement keys) to execute arrow key presses (down/up/...). I also defined several shortcuts involving the cmd-key.

Now, when I am in Alfred and want to scroll down through results with ctrl-j instead of using the arrow-down-key, it often (not always) opens the context menu (as if I just had pressed ctrl). Similarily, when I execute a shortcut involving the cmd-key in any application, sometimes (not always) the "Show Alfred with selected text"-workflow is triggered, which I have mapped to pressing cmd twice

These problems arised after updating to Mountain Lion and updating Keyboard Maestro to version 6. I already asked the Keyboard Maestro developer what he thinks how the problem might arise, this is what he answered:

 

Keyboard Maestro 6 uses an updated API for sending keystrokes.  Regardless of that, the sequence for sending a keystroke with modifiers is something like this:

*Release each modifier currently being held
* Release the key in question if it is held down
* Press each modifier key required
* Press the key in question
* Release the key in question
* Release each required modifier key
* Repress any modifier keys previously held down.

That is a lot of things happening in the background for each keypress.

So it is possible that Alfred is detecting some or these key events and making erroneous assumptions as to them being a 2 x command key press, or a control key press invoking the contextual menu or whatever.  I'm not sure there is anything I can do to reduce the issue, it is really up to Alfred to properly interpret the keys to know when to do what.

 

I am using Mac OS X 10.8.3 and Alfred v2.0.4(199)...

 

Thanks,

 

J

 

Link to comment
Share on other sites

Hi,

 

I defined several keyboard shortcuts in Keyboard Maestro, among others I use ctrl-j/ctrl-k/... (aka vim movement keys) to execute arrow key presses (down/up/...). I also defined several shortcuts involving the cmd-key.

Now, when I am in Alfred and want to scroll down through results with ctrl-j instead of using the arrow-down-key, it often (not always) opens the context menu (as if I just had pressed ctrl). Similarily, when I execute a shortcut involving the cmd-key in any application, sometimes (not always) the "Show Alfred with selected text"-workflow is triggered, which I have mapped to pressing cmd twice

These problems arised after updating to Mountain Lion and updating Keyboard Maestro to version 6. I already asked the Keyboard Maestro developer what he thinks how the problem might arise, this is what he answered:

 

 

I am using Mac OS X 10.8.3 and Alfred v2.0.4(199)...

 

Thanks,

 

J

 

I think the best thing you can do is turn off modifier keys for Alfred's action panel. You can do this in the Features > File Search > Actions panel, untick fn and ctrl, then Alfred will ignore this tap and hopefully this will fix your issues :)

 

Cheers,

Andrew

Link to comment
Share on other sites

Hi Andrew,

 

thanks for your answer! Using your advice, I can avoid the first problem, but the second ("Show Alfred with selected text" accidentally triggered) remains...

 

Thanks,

 

J

Link to comment
Share on other sites

Hi Andrew,

 

thanks for your answer! Using your advice, I can avoid the first problem, but the second ("Show Alfred with selected text" accidentally triggered) remains...

 

Thanks,

 

J

 

As Keyboard Mastro is simulating key presses, it may very well simulate what would be detected as a double cmd tap (as for security reasons, Alfred can only see modifiers changed in this case, not subsequent keyboard interaction).

 

Basically, you may find that double tab cmd for a combo in Alfred isn't compatible with Keyboard Maestro simulating the modifier keys tapping, so you'll have to use a different key combo in Alfred.

Link to comment
Share on other sites

  • 3 weeks later...

Hi Andrew,

 

I investigated this further and KeyboardMaestro does not seem to be the problem. I tried double presses with every possible key (Cmd, Ctrl, Alt, Shift) and the problem exist with every single one of them. So for example, when using Shift, the workflow will be triggered sometimes when I am writing text (where no KeyboardMaestro is active). So is the problem maybe due to the delay between the execution of the both key presses?! Is Alfred using a high value for that? Is there a way to manipulate the delay?! As I said, I never had the problem using Lion, and I never have it with LaunchBar that is also using a double click combo with one of the keys to send text etc. to Launchbar, so maybe they use a shorter delay?!

 

Thanks for your help,

 

Janosch

Link to comment
Share on other sites

Hi Andrew,

 

I investigated this further and KeyboardMaestro does not seem to be the problem. I tried double presses with every possible key (Cmd, Ctrl, Alt, Shift) and the problem exist with every single one of them. So for example, when using Shift, the workflow will be triggered sometimes when I am writing text (where no KeyboardMaestro is active). So is the problem maybe due to the delay between the execution of the both key presses?! Is Alfred using a high value for that? Is there a way to manipulate the delay?! As I said, I never had the problem using Lion, and I never have it with LaunchBar that is also using a double click combo with one of the keys to send text etc. to Launchbar, so maybe they use a shorter delay?!

 

Thanks for your help,

 

Janosch

 

I'll add a ticket, and if I get a moment, I'll take a look into wether the detection timings can be tweaked to avoid this situation.

Link to comment
Share on other sites

  • 3 weeks later...

Hi again,

 

I seem to have "solved" the issue by using the hack described on this side http://smithjw.me/blog/keyremap4macbook-alfred-file-selection, i.e. setting a "normal" keyboard shortcut for "Open Alfed with selected text" (like Cmd-Alt-A) and then using Keymap4Macbook to map pressing double ctrl (or whatever modifier) to execute this shortcut.

 

So far no accidental triggering...

 

This might not be a perfect solution, but works for me so far...

 

Best,

 

J

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...