Home Download Buy Blog Forum Support

Key bindings is no response...help

Key bindings is no response...help

Postby playboysen on Fri Aug 03, 2012 2:50 pm

I have some troubles when tring to develop some plugin.
I want to set SublimeText's main window to topmost using API SetWindowPos,and my code is:
Code: Select all
import sublime, sublime_plugin
from ctypes import *

user32    = windll.user32
classname = "PX_WINDOW_CLASS"
hWin      = user32.FindWindowA(classname,None)

class SetWindowTopCommand(sublime_plugin.TextCommand):
   def run(self, view):

It can work when I use
Code: Select all
in the console window,but when I create Default (Windows).sublime-keymap to bind some hot key to my plugin,it seems no response.

It is strange that the hot key can work when I open and save SetWindowTop.py again without any changes.
I need some help to know why,please?

1.jpg (30.27 KiB) Viewed 861 times

Default (Windows).sublime-keymap
2.jpg (12.32 KiB) Viewed 818 times
3.jpg (34.27 KiB) Viewed 811 times
Posts: 1
Joined: Fri Aug 03, 2012 2:36 pm

Re: Key bindings is no response...help

Postby nick. on Fri Aug 03, 2012 5:02 pm

You seem to have everything setup correctly. Have you tried
Code: Select all

to verify your keybindings and command are passing through to Sublime?
Posts: 266
Joined: Wed Jan 18, 2012 3:45 am

Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests