多个鼠标/鼠标/光标?

发布于 2024-09-06 04:46:52 字数 426 浏览 7 评论 0原文

如何为多个鼠标显示另一个光标?

我有两个 TMemo、两个可以输入各自 TMemo 的键盘、2 个鼠标,我需要 2 个光标。

如果假设的话,我已经可以检测出哪只老鼠是哪只。我怎样才能让我自己的光标跟着它一起走。 (使用德尔福) 可能沿着 Multipoint

作为替代方案,是否有任何软件它可以渲染多个光标。喜欢 CPNMouse 吗?

编辑: 我发现我可以在windows中使用mouse_event函数,但是我仍然没有光标的视觉表示。

How can I show another cursor for multiple mice?

I have two TMemos, two keyboards which can type into their respective TMemo, 2 mice and I need 2 cursors those.

If hypothetically, I can already detect which mouse is which. How can I make my own cursor to go along with it. (using Delphi)
Possibly along the lines of Multipoint

as an alternative, is there any software which can render more that one cursor. Like CPNMouse?

EDIT:
I found that I can use the mouse_event Function in windows, but I still don't have the visual representation of the cursor.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

七色彩虹 2024-09-13 04:46:52

游标只是资源。以下是可以使用的标准游标的详细列表。 TControl 定义一个光标属性,可以将其设置为在给定控件上时应使用的光标。您还可以使用 Screen.Cursor 来控制整个应用程序光标。

要定义自定义光标,请使用以下代码。

{$R MyCustomCursors.RES}

const
 crCustom1 = 1;
 crCustom2 = 2; 

...

  Screen.Cursors[crCustom1] := LoadCursor(hInstance, 'CUSTOM1');
  Screen.Cursors[crCustom2] := LoadCursor(hInstance, 'CUSTOM2');

...

Delphi 默认情况下并非设计用于处理多个鼠标指针,但我怀疑大多数环境并非如此。您提到的 SDK 是我见过的关于在单个应用程序中同时使用多个鼠标的唯一信息来源。然而它只是 .NET,因此使用它需要 Delphi Prism。

如果您想自己支持多个鼠标,可以使用使用 WM_INPUT 的相同技巧。 Windows 会将两只鼠标视为相同的。您必须为第二个鼠标手动自定义鼠标光标的绘制。

Cursors are just resources. Here is a good list of the standard cursors that can be used. TControl Defines a cursor property that can be set to the cursor that should be used when over a given control. You can also use Screen.Cursor to control the entire application cursor.

To define a custom cursor you use the following code.

{$R MyCustomCursors.RES}

const
 crCustom1 = 1;
 crCustom2 = 2; 

...

  Screen.Cursors[crCustom1] := LoadCursor(hInstance, 'CUSTOM1');
  Screen.Cursors[crCustom2] := LoadCursor(hInstance, 'CUSTOM2');

...

Delphi was not designed by default to deal with multiple mouse pointers, but the I suspect most environments are not. The SDK you mention is the only source of information I have seen on using multiple mice at the same time in a single application. It however is .NET only, so using it would require Delphi Prism.

If you want to roll your own support for multiple mice the same trick of using WM_INPUT can can be used. Windows will treat both mice as the same. You will have to do custom painting of the mouse cursor by hand for the second mouse.

苍白女子 2024-09-13 04:46:52

Windows 不支持多个鼠标或键盘。由于每个进程只有 1 个输入队列,因此 Windows 将所有类似的输入设备视为同一个设备。这无法改变。故事结束。时期。

但即使您无法在系统范围内执行此操作,您仍然可以在一个特定应用程序中执行此操作。您需要编写一个特殊的驱动程序并仅为第二个鼠标安装它。该驱动程序不应将鼠标移动传递给普通使用者(输入队列),而应将输入直接重定向到您的应用程序。

您可以使用已经编写的驱动程序 - 例如,这个您已经提到过的

Windows doesn't support multiple mouse or keyboards. Since each process have only 1 input queue, Windows treats all similar input devices as the same single device. This can't be changed. End of story. Period.

But even if you can't do this on system wide scale - you still can do this in one particular application. You need to write a special driver and install it for the second mouse only. This driver should not pass mouse movements to usual consumer (input queue), but rather redirect input directly to your application.

You can use a already written drivers - for example, this one or the one, that you've already mentioned.

秋意浓 2024-09-13 04:46:52

它可以通过快速执行某些操作来从原始光标虚拟地模拟其动作

It can be simulated its action virtually from the original cursor by doing something seamingly fast

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文