德尔福有“操纵杆”吗?控制?
我想使用鼠标将对象在 X 和 Y 方向上对齐,将其移动到位。我可以通过使用各种旋转控件(或按钮)来滚动解决方案,但它很混乱,我想知道是否有一个控件(例如操纵杆)可以使用鼠标提供 2 轴控制并以不同的速率触发事件它的地位?
I'd like to align an object in X and Y by eye using the mouse to move it into position. I can roll a solution by using various spin controls (or buttons) but it's messy and I got to wondering whether there is a control - like a joystick - that provides 2-axis control using the mouse and fires events at rates which vary depending on its position?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Afaik Jedi(jedi apilib?)也有一个操纵杆头。它是winapi,不是COM,所以不涉及TLB
Afaik Jedi (jedi apilib?) had a joystick header too. It is winapi, not COM, so no TLB involved
尝试 NLDJoystick,这是我编写的基于纯 WinAPI (MMSystem.pas)。它可以从 GitHub 下载。
界面:
Try NLDJoystick, an open-source component written by me and based on pure WinAPI (MMSystem.pas). It is downloadable from GitHub.
The interface:
也许你可以自己做类似的东西。
上面的内容非常原始,但应该可以工作。
Maybe you can make something like that yourself.
The above is very primitive, but should work.
我用谷歌搜索“joystick dll”并找到了无数。您可能可以将其中一个放入您的项目中,然后通过简单地为其编写一个 TLIB 标头(或无论它被称为什么,有一段时间没有这样做)来从 Delphi 访问其 C API。
I Googled for "joystick dll" and found countless. You can probably throw one of these into your project and then access its C API from Delphi by simply writing a TLIB header (or whatever it's called, haven't done this in a while) for it.
您可以使用DelphiX 组件。据我所知,它们是 DirectX 的包装器,其中之一包装了 DirectX 操纵杆接口。它采用 Delphi 风格包装,因此易于使用。
You may use a DelphiX components. They are wrappers for DirectX and one of them wraps around DirectX joystick interface as far as I remember. It wraps in a Delphi-style so it is easy to use.