From fa27d1a430936de45e606f6a61ea8a1034998d96 Mon Sep 17 00:00:00 2001 From: alswl Date: Tue, 1 Jul 2014 16:23:53 +0800 Subject: [PATCH] add space --- .phoenix.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.phoenix.js b/.phoenix.js index 28e44a61..e29ba76f 100644 --- a/.phoenix.js +++ b/.phoenix.js @@ -118,10 +118,14 @@ api.bind('/', mash, function() { switchApp('Finder'); }); // Multi screen api.bind('l', mash, function() { + save_mouse_position_for_now() Window.focusedWindow().focusNextScreen(); + restore_mouse_position_for_now() }); api.bind('h', mash, function() { + save_mouse_position_for_now() Window.focusedWindow().focusNextScreen(); + restore_mouse_position_for_now() }); api.bind('l', mashShift, function() { Window.focusedWindow().moveToScreen(Window.focusedWindow().screen().nextScreen()); @@ -154,6 +158,17 @@ api.bind('k', mash, function() { var alert_title = function(window) { api.alert(window.title())}; +api.bind('space', mash, function() { + var window = Window.focusedWindow(); + if (window === undefined) { + return; + } + MousePosition.restore({ + x: window.topLeft().x + window.frame().width / 2, + y: window.topLeft().y + window.frame().height / 2 + }); +}); + api.bind('0', mash, function() { var cw = Window.focusedWindow();