aboutsummaryrefslogtreecommitdiffstats
path: root/win-mouse.js
diff options
context:
space:
mode:
authoranekos2011-03-28 19:16:45 +0900
committeranekos2011-03-28 19:16:45 +0900
commit688d8935e573204aec3af99c255562d9c9514e0c (patch)
tree90fc53327c01a0e0a6ac1ac14890e4db79bb621c /win-mouse.js
parent31fefb5179cb04ece9fd321c531c7a311c65c2e0 (diff)
downloadvimperator-plugins-688d8935e573204aec3af99c255562d9c9514e0c.tar.bz2
自動 blur 機能追加
Diffstat (limited to 'win-mouse.js')
-rw-r--r--win-mouse.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/win-mouse.js b/win-mouse.js
index ae9f817..b1bd110 100644
--- a/win-mouse.js
+++ b/win-mouse.js
@@ -72,6 +72,15 @@ let INFO =
</p>
</description>
</item>
+ <item>
+ <tags>g:win_mouse_auto_blur</tags>
+ <spec>g:win_mouse_auto_blur = <a>msec</a></spec>
+ <description>
+ <p>
+ <a>msec</a> milliseconds after clicking, automatically blur(unfocus) from embed element.
+ </p>
+ </description>
+ </item>
</plugin>
</>;
// }}}
@@ -174,6 +183,8 @@ let INFO =
}
}
+
+
const API = __context__.API = {
get position () {
let pos = new CursorPosition(0, 0);
@@ -194,8 +205,20 @@ let INFO =
let vs = buttonNameToClickValues(name || 'left');
if (!vs)
throw 'Unknown button name';
+
[ClickInput[0].flags, ClickInput[1].flags] = vs;
SendInput(2, ClickInput.address(), MouseInput.size);
+
+ let autoBlur = liberator.globalVariables.win_mouse_auto_blur;
+ if (autoBlur) {
+ setTimeout(
+ function () {
+ if (modes.main === modes.EMBED)
+ liberator.focus.blur();
+ },
+ autoBlur
+ );
+ }
}
};
// }}}