Python论坛  - 讨论区

标题:[python-chinese] 请教如何写事件使窗口支持组合键

2006年04月13日 星期四 08:32

jason python.nbfan python.nbfan at gmail.com
Thu Apr 13 08:32:16 HKT 2006

我想让窗口上的按钮在按下alt+s后成为可点击状态。请问窗口事件怎么个写法。
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060413/176e119d/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月13日 星期四 10:51

Pau Lau paulau591 at gmail.com
Thu Apr 13 10:51:52 HKT 2006

在06-4-13,jason python.nbfan <python.nbfan at gmail.com> 写道:
>
> 我想让窗口上的按钮在按下alt+s后成为可点击状态。请问窗口事件怎么个写法。
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
> 方法很多,可以设置一个快捷键来实现,就象菜单的快捷键一样,也可以使用API。
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060413/2f400d20/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月13日 星期四 13:51

jason python.nbfan python.nbfan at gmail.com
Thu Apr 13 13:51:43 HKT 2006

能否具体说明一下,谢谢

在06-4-13,Pau Lau <paulau591 at gmail.com> 写道:
>
>
>
> 在06-4-13,jason python.nbfan <python.nbfan at gmail.com> 写道:
> >
> > 我想让窗口上的按钮在按下alt+s后成为可点击状态。请问窗口事件怎么个写法。
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> > 方法很多,可以设置一个快捷键来实现,就象菜单的快捷键一样,也可以使用API。
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060413/d0bfb9f8/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月13日 星期四 22:15

zhang yunfeng zhangyunfeng at gmail.com
Thu Apr 13 22:15:52 HKT 2006

绑定keyevent可以实现, 用MetaDown()函数来测试 's' 键按下时是否meta (也就是alt) 也按下了

wxKeyEvent::MetaDown
bool MetaDown() const
Returns true if the Meta key was down at the time of the key event.




在06-4-13,jason python.nbfan <python.nbfan at gmail.com> 写道:
>
> 我想让窗口上的按钮在按下alt+s后成为可点击状态。请问窗口事件怎么个写法。
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>


--
http://my.opera.com/zhangyunfeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060413/01450aa5/attachment.html

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月13日 星期四 22:20

zhang yunfeng zhangyunfeng at gmail.com
Thu Apr 13 22:20:34 HKT 2006

sorry, 原来有一个更加明确的函数 wxKeyEvent::AltDown

以前看emacs的教程里面用的meta键都是用alt键来完成的,所以...  呵呵

在06-4-13,zhang yunfeng <zhangyunfeng at gmail.com> 写道:
>
> 绑定keyevent可以实现, 用MetaDown()函数来测试 's' 键按下时是否meta (也就是alt) 也按下了
>
> wxKeyEvent::MetaDown
> bool MetaDown() const
> Returns true if the Meta key was down at the time of the key event.
>
>
>
>
>
> 在06-4-13,jason python.nbfan <python.nbfan at gmail.com> 写道:
> >
> > 我想让窗口上的按钮在按下alt+s后成为可点击状态。请问窗口事件怎么个写法。
> >
> > _______________________________________________
> > python-chinese
> > Post: send python-chinese at lists.python.cn
> > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> >
> >
>
>
> --
> http://my.opera.com/zhangyunfeng
>



--
http://my.opera.com/zhangyunfeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060413/274416e4/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2006年04月15日 星期六 12:05

jason python.nbfan python.nbfan at gmail.com
Sat Apr 15 12:05:13 HKT 2006

能不能给我个简单的例子,我搞不定,最后用alt+鼠标左键来实现。还是希望知道如何用键盘的组合键。
alt+鼠标左键代码

self.panel2.Bind(wx.EVT_MOUSE_EVENTS, self.OnPanel2MouseEvents)
def OnPanel2MouseEvents(self, event):
        if event.ButtonDown() and event.AltDown():
                   code:

在06-4-13,zhang yunfeng <zhangyunfeng at gmail.com> 写道:
>
> sorry, 原来有一个更加明确的函数 wxKeyEvent::AltDown
>
> 以前看emacs的教程里面用的meta键都是用alt键来完成的,所以...  呵呵
>
> 在06-4-13,zhang yunfeng < zhangyunfeng at gmail.com> 写道:
>
> > 绑定keyevent可以实现, 用MetaDown()函数来测试 's' 键按下时是否meta (也就是alt) 也按下了
> >
> > wxKeyEvent::MetaDown
> > bool MetaDown() const
> > Returns true if the Meta key was down at the time of the key event.
> >
> >
> >
> >
> >
> > 在06-4-13,jason python.nbfan < python.nbfan at gmail.com> 写道:
> > >
> > > 我想让窗口上的按钮在按下alt+s后成为可点击状态。请问窗口事件怎么个写法。
> > >
> > > _______________________________________________
> > > python-chinese
> > > Post: send python-chinese at lists.python.cn
> > > Subscribe: send subscribe to python-chinese-request at lists.python.cn
> > > Unsubscribe: send unsubscribe to
> > > python-chinese-request at lists.python.cn
> > > Detail Info: http://python.cn/mailman/listinfo/python-chinese
> > >
> > >
> >
> >
> > --
> > http://my.opera.com/zhangyunfeng
> >
>
>
>
> --
> http://my.opera.com/zhangyunfeng
>
> _______________________________________________
> python-chinese
> Post: send python-chinese at lists.python.cn
> Subscribe: send subscribe to python-chinese-request at lists.python.cn
> Unsubscribe: send unsubscribe to  python-chinese-request at lists.python.cn
> Detail Info: http://python.cn/mailman/listinfo/python-chinese
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.exoweb.net/pipermail/python-chinese/attachments/20060415/48958d9f/attachment.htm

[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2025

    京ICP备05028076号