shotcut_plg.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:imagepy 作者: Image-Py 项目源码 文件源码
def on_run(self, event):
        code = event.GetKeyCode()
        title = self.buf[event.GetIndex()][0]
        txt = self.buf[event.GetIndex()][1]
        if code == wx.WXK_DELETE:
            txt = ''
        elif code == wx.WXK_CONTROL: 
            txt = self.ist(txt, 'Ctrl')
        elif code == wx.WXK_ALT: 
            txt = self.ist(txt, 'Alt')
        elif code == wx.WXK_SHIFT: 
            txt = self.ist(txt, 'Shift')
        elif code in range(340,352):
            fs = ['F'+str(i) for i in range(1,13)]
            txt = self.ist(txt, fs[code-340])
        elif code<100: 
            txt = self.ist(txt, chr(event.GetKeyCode()))
        if len(txt)>0 and txt[-1]=='-':txt=txt[:-1]
        self.buf[event.GetIndex()][1] = txt
        self.lst_plgs.RefreshItem(event.GetIndex())
        if txt=='':ShotcutManager.rm(title)
        ShotcutManager.set(title, txt)
        #PluginsManager.plgs[self.buf[event.GetIndex()][0]]().start()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号