RectanglePro-Community icon indicating copy to clipboard operation
RectanglePro-Community copied to clipboard

"Next Space" and "Previous Space" only fiddles with mouse cursor if Mission Control keyboard shortcuts have been changed

Open VilleSalonen opened this issue 4 months ago • 7 comments

  • [X] This is a new bug that hasn't been documented in a closed issue or in the Readme.

macOS version: Tahoe 26.0.1 Rectangle version: 3.63 (204) Pro

I have a single display setup with three Mission Control spaces. Moving a window between the spaces works fine with Rectangle Pro's Next Space and Previous Space functionality if Mission Control keyboard shortcuts in macOS System Settings are the default ones.

However if I change from the default keyboard shortcuts of ⌃← and ^→ to something else such as ⌃ ⌥← and ⌃ ⌥→, when using Next Space or Previous Space only ever so briefly moves the mouse cursor to about the top left corner of the active window and then restores it previous location. Window is not moved at all like it is when using the default keyboard shortcuts.

I have verified multiple times that changing the keyboard shortcuts back to default immediately fixes the issue but changing it back to the non-default values breaks it. I also tested out changing the keyboard shortcuts to the non-default values and restarting Rectangle Pro but that didn't fix it.

Logs only show this in either case:

2025-11-09T07:18:55+02:00: Updating visible window info

My theory is that Rectangle Pro has these hardcoded somewhere and it is not reading the actual keyboard shortcuts.

I'm not an expert in Mac internal APIs but at least ChatGPT 5 provided this way of accessing the values:

Default values:

❯ /usr/libexec/PlistBuddy -c "Print :AppleSymbolicHotKeys:79" ~/Library/Preferences/com.apple.symbolichotkeys.plist
  /usr/libexec/PlistBuddy -c "Print :AppleSymbolicHotKeys:80" ~/Library/Preferences/com.apple.symbolichotkeys.plist
Dict {
    enabled = true
    value = Dict {
        type = standard
        parameters = Array {
            65535
            123
            8650752
        }
    }
}
Dict {
    enabled = true
    value = Dict {
        type = standard
        parameters = Array {
            65535
            123
            8781824
        }
    }
}

Non-default values:

❯ /usr/libexec/PlistBuddy -c "Print :AppleSymbolicHotKeys:79" ~/Library/Preferences/com.apple.symbolichotkeys.plist
  /usr/libexec/PlistBuddy -c "Print :AppleSymbolicHotKeys:80" ~/Library/Preferences/com.apple.symbolichotkeys.plist
Dict {
    enabled = true
    value = Dict {
        type = standard
        parameters = Array {
            65535
            123
            9175040
        }
    }
}
Dict {
    enabled = true
    value = Dict {
        type = standard
        parameters = Array {
            65535
            123
            9306112
        }
    }
}
Image

Working Mission Control shortcuts:

Image

Broken Mission Control shortcuts:

Image

VilleSalonen avatar Nov 09 '25 05:11 VilleSalonen

Thanks for the detailed report.

It's a little involved, but you'll have to configure Rectangle Pro to be aware of your next/prev space shortcuts with the following modified Terminal commands:

defaults write com.knollsoft.Hookshot nextSpaceShortcut -string "{\"keyCode\":<KEYCODE>,\"modifierFlags\":<MODIFIER_FLAGS>}"
defaults write com.knollsoft.Hookshot previousSpaceShortcut -string "{\"keyCode\":<KEYCODE>,\"modifierFlags\":<MODIFIER_FLAGS>}"

Replace <KEYCODE> and <MODIFIER_FLAGS> with the actual values. Left arrow is 123 and right arrow is 124. Control + option = 786432. Using the arrow key means you also need to add the fn modifier (8388608) so the total for modifiers is 9175040. You can use an app like Key Codes to obtain these values as well.

Then restart the app afterwards.

(I realize this is not ideal and it's on my todo list to build a better way to handle this)

rxhanson avatar Nov 09 '25 06:11 rxhanson

I still didn't quite manage to get it working. I tried with these

defaults write com.knollsoft.Hookshot nextSpaceShortcut -string "{\"keyCode\":124,\"modifierFlags\":786432}"
defaults write com.knollsoft.Hookshot previousSpaceShortcut -string "{\"keyCode\":123,\"modifierFlags\":786432}"

which showed up the values weirdly compared to Rectangle Pro's normal keyboard shortcuts:

    nextSpace =     {
        keyCode = 44;
        modifierFlags = 786432;
    };
    nextSpaceShortcut = "{\\"keyCode\\":124,\\"modifierFlags\\":786432}";
    prevSpace =     {
        keyCode = 47;
        modifierFlags = 786432;
    };
    previousSpaceShortcut = "{\\"keyCode\\":123,\\"modifierFlags\\":786432}";

After that I tried this:

defaults write com.knollsoft.Hookshot nextSpaceShortcut -dict keyCode 124 modifierFlags 786432
defaults write com.knollsoft.Hookshot previousSpaceShortcut -dict keyCode 123 modifierFlags 786432
defaults write com.knollsoft.Hookshot prevSpaceShortcut -dict keyCode 123 modifierFlags 786432

Then the data structures looked similar between nextSpace and nextSpaceShortcut it still wasn't working.

I also tried a few different modifier codes that Key Codes app showed me though I didn't manage to get any of those working even after restarting Rectangle Pro between retries.

I came to the conclusion that especially as there are other Mission Control keyboard shortcuts as well built around Control, I'm better off just sticking to those default macOS keyboard shortcuts.

Thanks for the quick reply though and for the great app! This has already changed the way I can use my Mac. Feel free to close this if you see fit.

VilleSalonen avatar Nov 09 '25 07:11 VilleSalonen

Hi, I think I have the same issue on MacOS Tahoe 26.1, Rectangle Pro 3.63.

I'm also using custom Misson Control shortcuts to move between spaces and I'm trying to set ⌃ ⌥⌘ ← and ⌃⌥⌘→ as shortcuts for "Previous Space" and "Next Space" in Rectangle.

Image Image

The same combination of keys works for "Next Display Centered" and "Previous Display Centered". I tried:

  • disabling Mission control shortcuts
  • running
defaults write com.knollsoft.Hookshot nextSpaceShortcut -string "{\"keyCode\":124,\"modifierFlags\":1835305}"
defaults write com.knollsoft.Hookshot nextSpaceShortcut -string "{\"keyCode\":123,\"modifierFlags\":1835305}"

and restarting the app

None worked 😢 I'm not sure if I'm doing something wrong here - could you please advise? Thank you

giuliac-edgetier avatar Nov 14 '25 18:11 giuliac-edgetier

Sorry about this, there is something I failed to communicate. If you are using arrow keys then you will also need to add the value for "fn".

You can add together all the modifier values from this chart:

Modifier Key Integer Value
cmd 1048576
option 524288
ctrl 262144
shift 131072
fn 8388608

For option + command + arrows:

defaults write com.knollsoft.Hookshot nextSpaceShortcut -string "{\"keyCode\":124,\"modifierFlags\":9961472}"
defaults write com.knollsoft.Hookshot previousSpaceShortcut -string "{\"keyCode\":123,\"modifierFlags\":9961472}"

For control + option + arrows:

defaults write com.knollsoft.Hookshot nextSpaceShortcut -string "{\"keyCode\":124,\"modifierFlags\": 9175040}"
defaults write com.knollsoft.Hookshot previousSpaceShortcut -string "{\"keyCode\":123,\"modifierFlags\": 9175040}"

Then restart the app.

Since I can't detect these shortcuts directly from within macOS, I'll plan on adjusting the shortcut recorder in such a way that modifiers and keys can be input separately so that this doesn't have to be done via command line.

rxhanson avatar Nov 15 '25 06:11 rxhanson

@rxhanson this is still not working for me unfortunately. I ran the commands to set ⌃ + ⌥ + arrows as the shortcut.

defaults write com.knollsoft.Hookshot nextSpaceShortcut -string "{\"keyCode\":124,\"modifierFlags\":9961472}"
defaults write com.knollsoft.Hookshot previousSpaceShortcut -string "{\"keyCode\":123,\"modifierFlags\":9961472}"

Then quit the app and re-opened it. I tried disabling the mission control custom shortcuts and I disabled the Karabiner custom profile as well to ensure they weren't interfering in any way.

Is there a way to check that the shortcut has been recorded correctly? After running the commands I don't see any changes in the interface.

Image

Is there anything else that might be interfering with the shortcuts that I can try and disable?

giuliac-edgetier avatar Nov 17 '25 11:11 giuliac-edgetier

The next space / previous space functionality seems competely broken for me, regardless of what settings i have in the app, and regardless of which of these commands I run. version 3.64, macos 26.1, m3 macbook pro.

marklackey avatar Dec 01 '25 18:12 marklackey

@giuliac-edgetier Sorry for the lack of response. There isn't anything that shows the defaults commands are registered in Rectangle Pro at this time. In your screenshot, there is nothing configured for the move window to next/previous space; should that be control+option+command+arrows? I'll add some logging so that we can see what Rectangle Pro is executing for switching spaces.

@marklackey Thanks for reporting. I'll need more information to understand what's going on. Do you see this for all apps, or specific ones? What do see when you execute next/previous space - does the cursor move? Do you already have a Space created in the next/previous position?

rxhanson avatar Dec 02 '25 07:12 rxhanson