在wxpython中使用修饰符进行拖放
有没有办法在 wxpython 中的拖放过程中捕获修饰符?在几篇文章中作为旁注提到了它(OLE 方式在wxPython中进行拖放,wx.TreeCtrl拖放放置、复制和移动),但这些都没有提到如何捕获这些修饰符。
我知道 CmdDown(),但这需要 EVT_CHAR。有没有办法在拖放(到画布)期间强制使用 EVT_CHAR?
归根结底,我可以使用一些全局钩子,但我知道类似的包中有等效的东西可以让你捕获修饰符。
任何帮助表示赞赏。
Is there a way to capture modifiers during a drag-and-drop in wxpython? It is mentioned in a couple of posts as a sidenote (The OLE way of doing drag&drop in wxPython, wx.TreeCtrl drag and drop, copy and move), but neither of those mentions how to catch these modifiers.
I am aware of CmdDown(), but that requires an EVT_CHAR. Is there a way to force an EVT_CHAR during a drag and drop (to a canvas)?
At the end of the day, I could use some global hook, but I know there are equivalents in similar packages that allow you to catch modifiers.
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我有用的是使用 GetMouseState() ,它包含用于修饰符的布尔值。我一直在尝试使用 GetKeyState(),但我需要传入一个关键代码。回想起来,我认为我可以传入任何键,然后检查修饰符,因为这就是我真正想要的。无论如何 - 现在可以了。
What worked for me was using GetMouseState() which has booleans for modifiers packed into it. I had been trying to use GetKeyState(), but I needed to pass in a key code. In retrospect, I think I could've passed in any key and then just checked for modifiers since that's what I actually want. Anyhow - it works now.