On Mavericks beta (on Yosemite), how do you trigger window movement commands?

11 views
Skip to first unread message

Christian Genco

unread,
Nov 11, 2014, 12:43:45 PM11/11/14
to keym...@googlegroups.com
This (from the docs) doesn't work:

map "<Ctrl-Shift-Cmd-J>", lambda{Commands[:'window_-_move_to_center']}

neither does:

map "<Ctrl-Shift-Cmd-J>", lambda{Commands['Window - Move to Center']}

It looks like somewhere in the beta the syntax was switched from things that look like this:

Commands.run_registered_command

to this:

trigger_item_with(Commands.items, RunRegisteredCommand.new)

and from the docs, it looks like there are two classes, ShiftWindow and MoveWindow, that have likely taken over for this functionality, but this doesn't work either:

ShiftWindow.new(:x => 10,:y => 10,:width => 20,:height => -20).run

(returns "uninitialized constant ShiftWindow")

---

Keymando, if it can still move windows around, scratches an itch I've had for quite a long time. I was on the brink of rolling my own solution until I stumbled on it. If given a little sprucing up on the documentation side, it'd easily be one of the most powerful tools on OS X.

If Keymando is written in Rubymotion, I'd love to help bring primary development forward to Yosemite. Shoot me an email if there's anything (even documentation) I can do to help! It'd be much easier to update Keymando than it would be to do my own thing.

Jean-Paul S. Boodhoo

unread,
Nov 11, 2014, 3:08:50 PM11/11/14
to keym...@googlegroups.com
Hey Christian,

If you want to see the key of a registered command, here are 2 useful mappings for you:

#Map command-space to trigger a registered command
map "<Cmd- >", Commands.run_registered_command

Once you have pressed this shortcut type to match the following:

Show key of registered command

When you run this, it will prompt you with another filter list where you type in the name of the command that you want to run.

Once you hit enter when it filters to the command you want, an alert dialog will pop up displaying the command details. For the example you gave the key for the command is :window_move_to_center

At that point I can use that key in a mapping as follows (I just did this and it works no problem):

map "<Cmd-8>", Commands[:window_move_to_center]

You can map directly to commands, without needing to be in a block.

Let me know if this helps.

God Bless You,

JP




On 11/11, Christian Genco wrote:
> This (from the docs) doesn't work:
>
> map "<Ctrl-Shift-Cmd-J>", lambda{Commands[:'window_-_move_to_center']}
>
> neither does:
>
> map "<Ctrl-Shift-Cmd-J>", lambda{Commands['Window - Move to Center']}
>
> It looks like somewhere in the beta the syntax was switched from things
> that look like this:
>
> Commands.run_registered_command
>
> to this:
>
> trigger_item_with(Commands.items, RunRegisteredCommand.new)
>
> and from the docs, it looks like there are two classes, ShiftWindow
> <http://updates.keymando.com/releases/current/doc/Accessibility/ShiftWindow.html>
> and MoveWindow
> <http://updates.keymando.com/releases/current/doc/Accessibility/MoveWindow.html>,
> that have likely taken over for this functionality, but this doesn't work
> either:
>
> ShiftWindow.new(:x => 10,:y => 10,:width => 20,:height => -20).run
>
> (returns "uninitialized constant ShiftWindow")
>
> ---
>
> Keymando, if it can still move windows around, scratches an itch I've had
> for quite a long time. I was on the brink of rolling my own solution until
> I stumbled on it. If given a little sprucing up on the documentation side,
> it'd easily be one of the most powerful tools on OS X.
>
> If Keymando is written in Rubymotion, I'd love to help bring primary
> development forward to Yosemite. Shoot me an email if there's anything
> (even documentation) I can do to help! It'd be much easier to update
> Keymando than it would be to do my own thing.
>
> --
> You received this message because you are subscribed to the Google Groups "Keymando" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to keymando+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Christian Genco

unread,
Nov 11, 2014, 3:12:54 PM11/11/14
to keym...@googlegroups.com
Ahh this is perfect! Thank you so much :D

You received this message because you are subscribed to a topic in the Google Groups "Keymando" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/keymando/ebKrkcBmPbE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to keymando+u...@googlegroups.com.

Jean-Paul S. Boodhoo

unread,
Nov 11, 2014, 3:20:09 PM11/11/14
to keym...@googlegroups.com
Hey Christian,

As an alternative to running out of mappings, here is an alternate approach. Use a leader key followed by a mnemonic. Here is an example:

except /(iTerm|MacVim)/ do
map ";wc", Commands[:window_move_to_center]
map ";wfs", Commands[:window_move_to_full_screen]

map ";uic", Commands.ui_controls
map ";lc", Commands.left_click_element
map ";rc", Commands.right_click_element
map ";dc", Commands.double_click_element
map ";mi", Commands.show_current_app_menu_items
map ";q", Commands.quit_current_application
end

I personally prefer either using the run dialog or mnemonics triggered by leaders so I don't need to maintain a mental map of remaps!

Jean-Paul S. Boodhoo

unread,
Nov 11, 2014, 3:23:11 PM11/11/14
to keym...@googlegroups.com
Hey Christian,

I would also recommend the following mapping (change to whatever map you like):

map "<Cmd-o>", Commands.run_last_command

That way, if you are on a multi monitor setup and your run one of the window positioning commands (move to top, left, center, full screen etc). When you "run the last command" it will repeat it cycling through all of your available monitors. Great way to quickly move windows between multi monitor setups.

It's also a great mapping if you are manipulating volume, advancing tracks in itunes etc. The possibilities are endless!
Reply all
Reply to author
Forward
0 new messages