Skip to content
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

Hotkeys handling breaks sometimes #46

Closed
nikitabobko opened this issue Dec 10, 2023 · 8 comments
Closed

Hotkeys handling breaks sometimes #46

nikitabobko opened this issue Dec 10, 2023 · 8 comments
Assignees
Labels
bug Something isn't working as expected

Comments

@nikitabobko
Copy link
Owner

nikitabobko commented Dec 10, 2023

AeroSpace v0.6.1-Beta abcd09d

h_tiles
  window1
  window2 (focused)
  window3

Steps:

  1. alt-shift-slash
  2. alt-shift-l
  3. alt-shift-h
  4. alt-shift-l
    Expected:
h_tiles
  window1
  window3
  window2 (focused)

Actual: Ò is typed on step 4 (alt-shift-l)

@nikitabobko
Copy link
Owner Author

Workaround: call reload-config

@nikitabobko nikitabobko self-assigned this Dec 16, 2023
@nikitabobko nikitabobko added the bug Something isn't working as expected label Jan 2, 2024
@winterscar
Copy link

As an alternative for anyone frustrated with this:
I deleted all the keybindings from my Aerospace config, and now I used SKHD to manage my aerospace keybindings. My config below if anyone wants to use it as a starting point:

# This keybinding uses a VIM-inspired but heavily simplified
# set of keys and layers to manipulate windows and workspaces
# using Aerospace.
# I have f16 and f17 bound on my keyboard to easy to press keys.

# === Layers ====================================

# Define the layers, tell sketchybar to show the active layer in
# the taskbar.

:: default : sketchybar --set skhd label="I"
:: active @ : sketchybar --set skhd label="A"

:: focus @  : sketchybar --set skhd label="F"
:: move @ : sketchybar --set skhd label="M"
:: organize @ : sketchybar --set skhd label="O"
:: desktop @ : sketchybar --set skhd label="D"
:: resize @ : sketchybar --set skhd label="R"
:: quick_focus @

# Activate
default < f16 ; active

# Handle returning to default mode
active, move, focus, organize, desktop, resize < escape ; default
active, move, focus, organize, desktop, resize < f16 ; default
active, move, focus, organize, desktop, resize < return ; default


# ==== Focus: Move focus from window to window ================
active < f ; focus

focus < h : aerospace focus --boundaries all-monitors-outer-frame left
focus < j : aerospace focus --boundaries all-monitors-outer-frame down
focus < k : aerospace focus --boundaries all-monitors-outer-frame up
focus < l : aerospace focus --boundaries all-monitors-outer-frame right

# Non-focus, but useful when in focus mode
focus < x : aerospace close
focus < f : aerospace fullscreen

# Often, you just want to move to the window next to the current one.
# These bindings move you one window, then exit back into 'insert mode'.
default < f17 ; quick_focus
quick_focus < h : aerospace focus --boundaries all-monitors-outer-frame left; skhd -k 'escape'
quick_focus < j : aerospace focus --boundaries all-monitors-outer-frame down; skhd -k 'escape'
quick_focus < k : aerospace focus --boundaries all-monitors-outer-frame up; skhd -k 'escape'
quick_focus < l : aerospace focus --boundaries all-monitors-outer-frame right; skhd -k 'escape'
quick_focus < escape ; default

# Quickly change to different modes from within focus mode
focus < m ; move
focus < o ; organize
focus < d ; desktop
focus < r ; resize

# ==== Move: Move windows both on desktop and across desktops ===
active < m ; move

move < h : aerospace move left
move < j : aerospace move down
move < k : aerospace move up
move < l : aerospace move right

move < 0x53 : aerospace move-node-to-workspace 1
move < 0x54 : aerospace move-node-to-workspace 2
move < 0x55 : aerospace move-node-to-workspace 3
move < 0x56 : aerospace move-node-to-workspace 4
move < 0x57 : aerospace move-node-to-workspace 5
move < 0x58 : aerospace move-node-to-workspace 6
move < 0x59 : aerospace move-node-to-workspace 7
move < 0x60 : aerospace move-node-to-workspace 8
move < 0x61 : aerospace move-node-to-workspace 9
move < 0x52 : aerospace move-node-to-workspace 0

# Shift-move means join.
move < shift-h : aerospace join-with left
move < shift-j : aerospace join-with down
move < shift-k : aerospace join-with up
move < shift-l : aerospace join-with right

# Quickly change to different modes from within move mode
move < f ; focus
move < o ; organize
move < d ; desktop
move < r ; resize

# === Organize: Change aerospace layouts. ========================
# Called organize because (l)ayout is one of the direction keys.
# so you wouldn't be able to switch to this mode from move and focus otherwise
active < o ; organize

organize < t     : aerospace layout tiles
organize < a     : aerospace layout accordion
# (f)ocus is taken for floating, so j/k to 'raise'/'lower'
organize < k     : aerospace layout floating
organize < j     : aerospace layout tiling
organize < h     : aerospace layout horizontal
organize < v     : aerospace layout vertical

# Quickly change to different modes from within organize mode
organize < f ; focus
organize < m ; move
organize < d ; desktop
organize < r ; resize

# === Desktop: switch to different desktops, move desktops across monitors
# I prefer 'desktop' to 'workspace'
active < d ; desktop

desktop < 0x53 : aerospace workspace 1
desktop < 0x54 : aerospace workspace 2
desktop < 0x55 : aerospace workspace 3
desktop < 0x56 : aerospace workspace 4
desktop < 0x57 : aerospace workspace 5
desktop < 0x58 : aerospace workspace 6
desktop < 0x59 : aerospace workspace 7
desktop < 0x60 : aerospace workspace 8
desktop < 0x61 : aerospace workspace 9
desktop < 0x52 : aerospace workspace 0
# Move this desktop to other monitor
desktop < n    : aerospace move-workspace-to-monitor --wrap-around next
# Switch to the previous desktop
desktop < tab  : aerospace workspace-back-and-forth

# Quickly change to different modes from within desktop mode
desktop < f ; focus
desktop < m ; move
desktop < o ; organize
desktop < r ; resize

# === Resize: Make windows bigger or smaller ============
active < r ; resize

resize < h : aerospace resize width -50
resize < l : aerospace resize width +50
resize < j : aerospace resize height -50
resize < k : aerospace resize height +50

resize < shift-h : aerospace resize width -200
resize < shift-l : aerospace resize width +200
resize < shift-j : aerospace resize height -200
resize < shift-k : aerospace resize height +200

# Quickly change to different modes from within resize mode
resize < f ; focus
resize < m ; move
resize < o ; organize
resize < d ; desktop

@nikitabobko nikitabobko added this to the 0.9.0-Beta milestone Jan 29, 2024
@nikitabobko nikitabobko removed this from the 0.9.0-Beta milestone Feb 4, 2024
@nikitabobko
Copy link
Owner Author

Should be fixed in 0.8.4-Beta

@yzlnew
Copy link

yzlnew commented Feb 6, 2024

alt-h, alt-shift-1, alt-shift-h, etc still not working for me in 0.8.4-Beta.
alt-1 is working.

@nikitabobko
Copy link
Owner Author

alt-h, alt-shift-1, alt-shift-h, etc still not working for me in 0.8.4-Beta.

Please elaborate. What is your config, and what sequence of keys do you press?

@yzlnew
Copy link

yzlnew commented Feb 6, 2024

@nikitabobko Default config from https://nikitabobko.github.io/AeroSpace/config-examples.html#default-config
These keys just do not work for me. I change alt-h to alt-left, then I can change focus.

@nikitabobko
Copy link
Owner Author

nikitabobko commented Feb 6, 2024

  1. Please make sure that you don't have any other software running that may intercept global hotkeys (e.g. skhd)
  2. Try to reboot

@yzlnew
Copy link

yzlnew commented Feb 7, 2024

@nikitabobko Thanks! Turns out that I forgot to uninstall skhd along with yabai. After a full reboot, working fine now.

jakenvac pushed a commit to jakenvac/AeroSpace that referenced this issue Aug 16, 2024
- Use isPaused instead of destroying and creating HotKey object
- Be incremental during binding mode switch. Don't touch (turn off and
  turn on) hotkeys that exist in both modes

closes nikitabobko#46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants