Permalink
Browse files

* track mouse clicks globally

  • Loading branch information...
DisposaBoy
DisposaBoy committed Dec 27, 2012
1 parent a1bafc3 commit 3f709e6bee80a8b7bf65bed07ab9615fe58fed4d
Showing with 19 additions and 15 deletions.
  1. +3 −5 Default (Linux).sublime-mousemap
  2. +3 −5 Default (OSX).sublime-mousemap
  3. +3 −5 Default (Windows).sublime-mousemap
  4. +10 −0 gsev.py
@@ -3,14 +3,12 @@
"button": "button1",
"modifiers": ["ctrl", "shift"],
"press_command": "drag_select",
"command": "gs_doc",
"args": {"mode": "goto"}
"command": "gs_on_left_click"
},
{
"button": "button2",
"modifiers": ["ctrl", "shift"],
"press_command": "drag_select",
"command": "gs_doc",
"args": {"mode": "hint"}
"command": "gs_on_right_click"
}
]
]
@@ -3,14 +3,12 @@
"button": "button1",
"modifiers": ["super", "shift"],
"press_command": "drag_select",
"command": "gs_doc",
"args": {"mode": "goto"}
"command": "gs_on_left_click"
},
{
"button": "button2",
"modifiers": ["super", "shift"],
"press_command": "drag_select",
"command": "gs_doc",
"args": {"mode": "hint"}
"command": "gs_on_right_click"
}
]
]
@@ -3,14 +3,12 @@
"button": "button1",
"modifiers": ["ctrl", "shift"],
"press_command": "drag_select",
"command": "gs_doc",
"args": {"mode": "goto"}
"command": "gs_on_left_click"
},
{
"button": "button2",
"modifiers": ["ctrl", "shift"],
"press_command": "drag_select",
"command": "gs_doc",
"args": {"mode": "hint"}
"command": "gs_on_right_click"
}
]
]
10 gsev.py
@@ -12,6 +12,16 @@ def on_post_save(self, view):
def on_activated(self, view):
sublime.set_timeout(lambda: do_sync_active_view(view), 0)

class GsOnLeftClick(sublime_plugin.TextCommand):
def run(self, edit):
if gs.is_go_source_view(self.view):
self.view.run_command('gs_doc', {"mode": "goto"})

class GsOnRightClick(sublime_plugin.TextCommand):
def run(self, edit):
if gs.is_go_source_view(self.view):
self.view.run_command('gs_doc', {"mode": "hint"})

def do_post_save(view):
if not gs.is_pkg_view(view):
return

0 comments on commit 3f709e6

Please sign in to comment.