koekeishiya / yabai

A tiling window manager for macOS based on binary space partitioning
MIT License
23.44k stars 644 forks source link

hyper + <mod> doesn't seem to work #843

Closed ThSGM closed 3 years ago

ThSGM commented 3 years ago

The following does work:

# focus window
hyper - h : yabai -m window --focus west
hyper - j : yabai -m window --focus south
hyper - k : yabai -m window --focus north
hyper - l : yabai -m window --focus east

# move window
cmd + shift - h : yabai -m window --warp west
cmd + shift - j : yabai -m window --warp south
cmd + shift - k : yabai -m window --warp north
cmd + shift - l : yabai -m window --warp east

but if I replace "cmd" with "hyper" in the second set of commands, it does not work. It seems that hyper + doesn't work. Here, I've set up the hyper key via Karabiner.

tshu-w commented 3 years ago

hyper(cmd + shift + alt + ctrl) in skhd is different in Karabiner? A list of all built-in modifier and literal keywords of skhd can be found https://github.com/koekeishiya/skhd/issues/1#issue-248494406

ThSGM commented 3 years ago

@tshu-w You're right. I'm an idiot and the shift key is already part of hyper!

gerardbosch commented 3 years ago

I don't know much about the details, but with http://capslock.vonng.com modifications (via Karabiner-elements), a new Hyper key is created (replacing the Caps Lock) that acts as R Ctrl + R Opt + R Cmd + R Shift.

And, using this setup, Hyper can be mixed with other left modifiers to allow extra functionality like: Hyper + Left Cmd.

P.S. I can think on things like "Move window to next space": Hyper + L Shift + L

gerardbosch commented 3 years ago

This is what I get when I hold down the Hyper key (the Caps Lock).

image

And something similar (just different flags) shows when I hold R Shift

image

that does not match the expected 38 for Shift according to https://github.com/koekeishiya/skhd/issues/1

justdanyul commented 3 years ago

I don't know much about the details, but with http://capslock.vonng.com modifications (via Karabiner-elements), a new Hyper key is created (replacing the Caps Lock) that acts as R Ctrl + R Opt + R Cmd + R Shift.

And, using this setup, Hyper can be mixed with other left modifiers to allow extra functionality like: Hyper + Left Cmd.

* Can this be achieved in skhd? or is it possible to redefine skhd built-in Hyper definition to use right modifiers and leave left modifiers to further combine with hyper? Thx!

P.S. I can think on things like "Move window to next space": Hyper + L Shift + L

I'd love to be able to do this as well. Comparing with my i3wm setup, having a hyper + shit style modifier (that doesn't clash with other things) one of the few things that i find myself missing

justdanyul commented 3 years ago

I don't know much about the details, but with http://capslock.vonng.com modifications (via Karabiner-elements), a new Hyper key is created (replacing the Caps Lock) that acts as R Ctrl + R Opt + R Cmd + R Shift.

And, using this setup, Hyper can be mixed with other left modifiers to allow extra functionality like: Hyper + Left Cmd.

* Can this be achieved in skhd? or is it possible to redefine skhd built-in Hyper definition to use right modifiers and leave left modifiers to further combine with hyper? Thx!

P.S. I can think on things like "Move window to next space": Hyper + L Shift + L

I'm not sure if you solved this already. But your post inspired me to play around with karabiner elements a bit. In short, if you use the default "change caps_lock to command+control+option+shift" rule, and go into .config/karabiner/karabiner.json to can just change the "to" part of the code to right_shift, right_command etc.

This works for me, and it allows me to use right_shift + right_cmd + right_control + right_option as hyper, and modify this with lshift skhd. having hyper + left_shift + arrows to move windows for example

gerardbosch commented 2 years ago

Hi @justdanyul, I'm glad to listen I inspired anything :) I think that what you describe in Karabiner is what Capslock Enhancement does: define the hyper key that maps to the 4 right modifiers.

Then, I guess but I'm not very sure that you should be able to do in the following in shkd:

rcmd + rshift + ralt + rctrl + lshift - l : yabay -m window ...

But, as I understood, the following won't work instead:

hyper + lshift - l : yabay -m window ...

as the shkd definition of the hyper keyword may not use the right modifiers (I don't see this specified here)

Finally for anyone interested I found https://github.com/kmonad/kmonad an awesome tool to declare advanced keyboard manipulations that is multi-platform, so your own keyboard customization would work in MacOs, Linux and Windows.

(This question should be probably posted in the shkd project instead of yabai, sorry if it landed in the wrong place)