-
-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aerospace not registering key presses on letter keys #732
Comments
I'm not sure of the trigger but I think I'm running into the same (or a similar) bug. My my aerospace.toml
I'm on |
I just stumbled across this, and have found another peculiarity: If I add
at the very end of my But if I move the binding up, just below all the
binds, the keypress registers. |
Something related for me as well, e.g. Issue detected in 0.16.0, 0.16.1 and now 0.16.2. Also updated macOS to 15.1.1 (could be related, but sadly I've already upgraded all my macOS instances, so I can't verify if this was the case). PS: If I change to using e.g.
# Place a copy of this config to ~/.aerospace.toml
# After that, you can edit ~/.aerospace.toml to your liking
# You can use it to add commands that run after login to macOS user session.
# 'start-at-login' needs to be 'true' for 'after-login-command' to work
# Available commands: https://nikitabobko.github.io/AeroSpace/commands
after-login-command = []
# You can use it to add commands that run after AeroSpace startup.
# 'after-startup-command' is run after 'after-login-command'
# Available commands : https://nikitabobko.github.io/AeroSpace/commands
after-startup-command = []
# Start AeroSpace at login
start-at-login = false
# Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
# See: https://nikitabobko.github.io/AeroSpace/guide#layouts
# The 'accordion-padding' specifies the size of accordion padding
# You can set 0 to disable the padding feature
accordion-padding = 30
# Possible values: tiles|accordion
default-root-container-layout = 'tiles'
# Possible values: horizontal|vertical|auto
# 'auto' means: wide monitor (anything wider than high) gets horizontal orientation,
# tall monitor (anything higher than wide) gets vertical orientation
default-root-container-orientation = 'auto'
# Mouse follows focus when focused monitor changes
# Drop it from your config, if you don't like this behavior
# See https://nikitabobko.github.io/AeroSpace/guide#on-focus-changed-callbacks
# See https://nikitabobko.github.io/AeroSpace/commands#move-mouse
# Fallback value (if you omit the key): on-focused-monitor-changed = []
on-focused-monitor-changed = ['move-mouse monitor-lazy-center']
# You can effectively turn off macOS "Hide application" (cmd-h) feature by toggling this flag
# Useful if you don't use this macOS feature, but accidentally hit cmd-h or cmd-alt-h key
# Also see: https://nikitabobko.github.io/AeroSpace/goodness#disable-hide-app
automatically-unhide-macos-hidden-apps = false
# Possible values: (qwerty|dvorak)
# See https://nikitabobko.github.io/AeroSpace/guide#key-mapping
[key-mapping]
preset = 'qwerty'
# Gaps between windows (inner-*) and between monitor edges (outer-*).
# Possible values:
# - Constant: gaps.outer.top = 8
# - Per monitor: gaps.outer.top = [{ monitor.main = 16 }, { monitor."some-pattern" = 32 }, 24]
# In this example, 24 is a default value when there is no match.
# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'.
# See: https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors
[gaps]
inner.horizontal = 0
inner.vertical = 0
outer.left = 0
outer.bottom = 0
outer.top = 0
outer.right = 0
# 'main' binding mode declaration
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
# 'main' binding mode must be always presented
# Fallback value (if you omit the key): mode.main.binding = {}
[mode.main.binding]
# All possible keys:
# - Letters. a, b, c, ..., z
# - Numbers. 0, 1, 2, ..., 9
# - Keypad numbers. keypad0, keypad1, keypad2, ..., keypad9
# - F-keys. f1, f2, ..., f20
# - Special keys. minus, equal, period, comma, slash, backslash, quote, semicolon, backtick,
# leftSquareBracket, rightSquareBracket, space, enter, esc, backspace, tab
# - Keypad special. keypadClear, keypadDecimalMark, keypadDivide, keypadEnter, keypadEqual,
# keypadMinus, keypadMultiply, keypadPlus
# - Arrows. left, down, up, right
# All possible modifiers: cmd, alt, ctrl, shift
# All possible commands: https://nikitabobko.github.io/AeroSpace/commands
# See: https://nikitabobko.github.io/AeroSpace/commands#exec-and-forget
# You can uncomment the following lines to open up terminal with alt + enter shortcut (like in i3)
# alt-enter = '''exec-and-forget osascript -e '
# tell application "Terminal"
# do script
# activate
# end tell'
# '''
# See: https://nikitabobko.github.io/AeroSpace/commands#layout
alt-slash = 'layout tiles horizontal vertical'
ctrl-comma = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'
# See: https://nikitabobko.github.io/AeroSpace/commands#focus
alt-h = 'focus left'
alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'
# See: https://nikitabobko.github.io/AeroSpace/commands#move
alt-shift-h = 'move left'
alt-shift-j = 'move down'
alt-shift-k = 'move up'
alt-shift-l = 'move right'
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
alt-shift-minus = 'resize smart -50'
alt-shift-equal = 'resize smart +50'
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
alt-1 = 'workspace 1'
alt-2 = 'workspace 2'
alt-3 = 'workspace 3'
alt-4 = 'workspace 4'
alt-5 = 'workspace 5'
alt-6 = 'workspace 6'
# alt-7 = 'workspace 7'
# alt-8 = 'workspace 8'
# alt-9 = 'workspace 9'
alt-a = 'workspace A' # In your config, you can drop workspace bindings that you don't need
alt-b = 'workspace B'
alt-c = 'workspace C'
alt-d = 'workspace D'
alt-e = 'workspace E'
# alt-f = 'workspace F'
alt-g = 'workspace G'
alt-i = 'workspace I'
alt-m = 'workspace M'
alt-n = 'workspace N'
alt-o = 'workspace O'
alt-p = 'workspace P'
alt-q = 'workspace Q'
alt-r = 'workspace R'
alt-s = 'workspace S'
alt-t = 'workspace T'
alt-u = 'workspace U'
alt-v = 'workspace V'
alt-w = 'workspace W'
alt-x = 'workspace X'
alt-y = 'workspace Y'
# alt-z = 'workspace Z'
# See: https://nikitabobko.github.io/AeroSpace/commands#move-node-to-workspace
alt-shift-1 = 'move-node-to-workspace 1'
alt-shift-2 = 'move-node-to-workspace 2'
alt-shift-3 = 'move-node-to-workspace 3'
alt-shift-4 = 'move-node-to-workspace 4'
alt-shift-5 = 'move-node-to-workspace 5'
alt-shift-6 = 'move-node-to-workspace 6'
# alt-shift-7 = 'move-node-to-workspace 7'
# alt-shift-8 = 'move-node-to-workspace 8'
# alt-shift-9 = 'move-node-to-workspace 9'
alt-shift-a = 'move-node-to-workspace A'
alt-shift-b = 'move-node-to-workspace B'
alt-shift-c = 'move-node-to-workspace C'
alt-shift-d = 'move-node-to-workspace D'
alt-shift-e = 'move-node-to-workspace E'
# alt-shift-f = 'move-node-to-workspace F'
alt-shift-g = 'move-node-to-workspace G'
alt-shift-i = 'move-node-to-workspace I'
alt-shift-m = 'move-node-to-workspace M'
alt-shift-n = 'move-node-to-workspace N'
alt-shift-o = 'move-node-to-workspace O'
alt-shift-p = 'move-node-to-workspace P'
alt-shift-q = 'move-node-to-workspace Q'
alt-shift-r = 'move-node-to-workspace R'
alt-shift-s = 'move-node-to-workspace S'
alt-shift-t = 'move-node-to-workspace T'
alt-shift-u = 'move-node-to-workspace U'
alt-shift-v = 'move-node-to-workspace V'
alt-shift-w = 'move-node-to-workspace W'
alt-shift-x = 'move-node-to-workspace X'
alt-shift-y = 'move-node-to-workspace Y'
# alt-shift-z = 'move-node-to-workspace Z'
# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
alt-tab = 'workspace-back-and-forth'
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
alt-shift-tab = 'move-workspace-to-monitor --wrap-around next'
# esod
# ---
ctrl-alt-cmd-space = 'layout floating tiling'
ctrl-shift-space = 'layout horizontal vertical'
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
ctrl-shift-l = 'move-node-to-monitor right --focus-follows-window'
ctrl-shift-h = 'move-node-to-monitor left --focus-follows-window'
# See: https://nikitabobko.github.io/AeroSpace/commands#balance-sizes
ctrl-alt-space = 'balance-sizes'
# See: https://nikitabobko.github.io/AeroSpace/commands#resize
ctrl-alt-k = 'resize smart +50'
ctrl-alt-j = 'resize smart -50'
# same, but more size
ctrl-alt-h = 'resize smart -350'
ctrl-alt-l = 'resize smart +350'
# fullscreen
alt-f = 'fullscreen'
alt-z = 'fullscreen'
alt-shift-esc = 'mode service'
# See: https://nikitabobko.github.io/AeroSpace/commands#mode
alt-shift-semicolon = 'mode service'
# 'service' binding mode declaration.
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
[mode.service.binding]
esc = ['reload-config', 'mode main']
r = ['flatten-workspace-tree', 'mode main'] # reset layout
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
backspace = ['close-all-windows-but-current', 'mode main']
# sticky is not yet supported https://github.com/nikitabobko/AeroSpace/issues/2
#s = ['layout sticky tiling', 'mode main']
alt-shift-h = ['join-with left', 'mode main']
alt-shift-j = ['join-with down', 'mode main']
alt-shift-k = ['join-with up', 'mode main']
alt-shift-l = ['join-with right', 'mode main']
[[on-window-detected]]
if.app-id = 'md.obsidian'
run = "move-node-to-workspace 1"
[[on-window-detected]]
if.app-id = 'com.google.Chrome'
run = "move-node-to-workspace 2"
[[on-window-detected]]
if.app-id = 'com.github.wez.wezterm'
run = "move-node-to-workspace 3"
[[on-window-detected]]
if.app-id = 'com.citrix.receiver.icaviewer.mac'
run = "move-node-to-workspace 4"
[[on-window-detected]]
if.app-id = 'com.citrix.receiver.nomas'
run = "move-node-to-workspace 4"
[[on-window-detected]]
if.app-id = 'company.thebrowser.Browser'
run = "move-node-to-workspace 5"
[[on-window-detected]]
if.app-id = 'com.todoist.mac.Todoist'
run = "move-node-to-workspace N"
[[on-window-detected]]
if.app-id = 'com.flexibits.fantastical2.mac'
run = "move-node-to-workspace N"
[[on-window-detected]]
if.app-id = 'com.microsoft.teams2'
run = "move-node-to-workspace P"
[[on-window-detected]]
if.app-id = 'com.hnc.Discord'
run = "move-node-to-workspace P"
[[on-window-detected]]
if.app-id = 'com.spotify.client'
run = "move-node-to-workspace P"
|
My mistake! Hammerspoon was interfering. |
I am experiencing this intermittently, but once it happens, it requires a reboot to be fixed. Could this be something within macOS? I have attempted to look through fs_usage logs, as well as utilize tools such as Shortcut Detector to determine if anything was getting caught in between, but with no luck. At some point, the alt combinations just fail to be caught by aerospace, even after a config reload, and complete stop and start of the application. At that point, alt keys work regularly, in any application they are used in, providing the correct shortcuts for that particular application. I have no other applications that claim the use of that key at a global level. |
What I realized is that the modes (like service mode or any custom mode we add) are not being cleared. The app stays on service mode or app mode or any mode after we run a command, even if we run it by adding You can see that by looking at the menubar and noticing the And by restarting, you are effectively forcing it back to main mode |
Restarting doesn't fix the issue I reported. Something is persistent with the issue where it wont register letter keys anymore (though keys pressed with a modifier key are captured) if I remember correctly. |
This is unfortunately not what I am experiencing. If that were the case, a restart of the application itself should fix it, but it doesn't. I need to reboot my system entirely for it to work properly again. The mode seems to be in normal mode when this happens. The alt combinations just don't work (except for alt tab, which does work switching to the previous workspace). |
I had
in my aerospace config, the alt-space never used to work, but now it works, but alt-f is not working anymore, also not if i comment the alt-space. Alt+ number also does not work anymore. |
I think this is related to macOS Sequoia. Aerospace was working perfectly for me, until I updated from Sonoma. Now I'm having this issue as well. |
Update: I rebooted, the issue went away. Some time later, I (co-incidentally) ran |
I had skhd running as well, but killing the process did not fix it. I know uninstalled skhd. Will report back in some time on if this fixes it for me. |
Restarting does not fix it for me, and I never had skhd installed (or anything else capturing across the board afaik). I am on Sequoia. What I'm experiencing seems to match up directly to what @samholmes is. |
FWIW, I have the same problem. I was working along configuring Aerospace things earlier this morning, and just when I sat down to start doing some real work I found that shortcuts from the docs config like One thing I can add to everybody else's descriptions. I have a setup for multi-monitor that uses modes. Like this:
Now, before the problem occurred today I had the keys in the I'm on Sequoia 15.2, but I was also there this morning when all was good. I double checked for things like Hammerspoon and skhd since I had them installed before, but I didn't find anything. I guess Aerospace could use a "debug keyboard shortcuts" mode where it outputs on the console what keyboard shortcuts it can "see" -- that would make it a bit easier to try around with various running apps and see if any specific one interrupts the correct recognition of keyboard shortcuts. Edit: another example for the problem with bindings in modes just came up. Since my
But it did not work! I just got stuck in service mode because there was no reaction to I changed the setup to this and now it's all good:
Technically I can't swear that this issue with bindings in modes is the same as the one that prevents alt combos from working -- but both these problems certainly kicked in for me at exactly the same time. |
Could this potentially have something to do with the number of workspaces available to use? Upon initially installing, I left the default config as-is with all of the pre-defined workspaces, 0-9 and a-z. I noticed after switching back and forth between workspaces quickly, the switch would start to slow down, and at some point, it would be so behind that I could not even open the menu in the top bar for aerospace until I gave it time to catch up. At this time, I could not use any key bindings, however whatever key binds I pushed would seemingly get added to the queue and be performed in sequence whenever aerospace caught up. Thinking about this, I removed most of the workspaces keybindings from the config and left only those which I actually use (about 5). After doing this, workspace switches are much faster. To me this seems like an un-optomized process lurking in the workspace switching logic. Can't say if it is the cause of the original issue here, but something to consider |
I found something pretty interesting today: the Alt/Option key is used by the Mac for something called the Accessibility Inspector, if and when that feature has been enabled. I never consciously enabled this and I was surprised to find that it was active. I noticed this first because when I pressed and held the Alt key, I noticed that there was a cross-shaped mouse cursor being used over certain UI elements. So I went into the system settings at accessibility/shortcuts and then I saw that the feature was active. The screenshot shows all those checkboxes disabled, but when I first got into this dialog, they were all enabled. I wonder if I accidentally pressed the keyboard shortcut at some point that's mentioned in the dialog -- I checked keyboard shortcuts in System Settings as well, and it was disabled so I'm not sure that can be the reason. Hope this helps someone -- I haven't done all possible tests yet, but this is clearly a feature that could interfere with keyboard shortcuts, so I guess it can't hurt to mention it here. |
I am having this issue as well. I can reliably break all shortcuts by locking the computer with Edit: Well, this is awkward, while it was consistently breaking as described above when locking/suspending, I can no longer reproduce this issue. |
Experienced the exact same thing, then I started killing apps one by one to see which one was interfering. Killing Bitwarden completely resolved the issue - I have no idea why it would be taking over all Options shortcuts though, but it worked. |
This is pretty interesting. I think the issue might involve an app that never actually gets focus, but still sits there waiting for a password input. Generally speaking, on macOS, if password input is focused, global shortcuts don't work, this is a known behavior. How to reproduce:
It seems like at step 4, there’s some hidden password input that “has focus,” causing the OS to disable shortcuts. If you ever bring that app to the foreground, click on somewhere else to defocus password input or kill it, shortcuts start working again, even after another lock/unlock cycle. Removing Bitwarden from the login items also fixes this. I’m guessing this isn’t limited to Bitwarden. Any app that starts up focused on a password input could cause the same kind of shortcut lockout. |
I experienced this a ton back when I used Yabai/skhd. (Some?) password input fields enable "secure input" mode - basically, macOS's way of preventing keystroke logging. My Yabai/skhd keyboard shortcuts never worked when e.g. I had Chrome open in the background, with the cursor sitting in the password field waiting to login to my Proxmox server. The interesting thing is, I don't run into that situation using Aerospace, despite the same circumstances coming up all the time. Maybe Apple updated the APIs for dealing with this but some apps (e.g. BitWarden) are still using an old method? Shot in the dark. It's interesting nonetheless. |
I tried to verify this but I can't. This morning my Alt-combos work correctly, and the existence of various login entries fields in other windows does nothing to deter them. Yep, even with the Touch ID dialog hanging around on one screen, I can still use Edit: one thing I find is that if I focus the password entry field in 1Password, I can't use |
I can consistently reproduce with NordPass. When you open NordPass the login window gets put in background automatically, so you usually don't notice. But as long as that window is open somewhere This does not happen with Bitwarden (although I only have browser extension) 🤷 |
Describe the bug
Aerospace works great for a majority of the time. It suddenly stops tracking keyboard letter and number keys but chorded keys with modifiers will still work. It seems to have been caused by connecting to a monitor. I don't have a repo steps, but when it happens, it happens and it's not clear how to fix it.
Known solution
I stopped using Aerospace for now because it's not reliable enough at the moment. I wish I could help in anyway to improve it's reliability.
Steps to Reproduce
Use my config for a while and use an external monitor it'll eventually happen (maybe):
The text was updated successfully, but these errors were encountered: