c# 模拟 鼠标按住不放_如何在不按住鼠标键的情况下模拟拖放?

c# 模拟 鼠标按住不放_如何在不按住鼠标键的情况下模拟拖放?

c# 模拟 鼠标按住不放

c# 模拟 鼠标按住不放_如何在不按住鼠标键的情况下模拟拖放?

Performing a standard drag and drop motion with a mouse or track pad is not hard to do normally, but if you are recovering from an injury, then some activities or motions may be problematic and painful. With that in mind, today’s SuperUser Q&A post is ready to help a reader in pain.

通常,用鼠标或触控板执行标准的拖放动作并不难,但是如果您正从受伤中恢复过来,那么某些活动或动作可能会成问题且痛苦。 考虑到这一点,今天的SuperUser Q&A帖子已准备好帮助处于痛苦中的读者。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

问题 (The Question)

SuperUser reader Jason S wants to know how to emulate drag and drop without holding the mouse button down:

超级用户阅读器Jason S想知道如何在不按住鼠标键的情况下模拟拖放:

I am currently recovering from an upper back injury and finding that the drag and drop mouse action is irritating some of my upper back muscles. Moving the mouse cursor is not a problem, but keeping the button held down while moving it is (in reality, I use a track pad, but it is the same issue).

我目前正从上背部受伤中恢复过来,发现拖放鼠标的动作正在刺激我的某些上背部肌肉。 移动鼠标光标不是问题,但是在移动按钮时按住它是可以的(实际上,我使用触控板,但这是同样的问题)。

Is there anything for Windows 7 (like some kind of plugin software, for example) that I could use as an alternative or replacement for drag and drop that would work the same way? In other words, I could do something like Shift+Click and it would make the operating system think that the mouse button is still being held down until I click somewhere else? Like this:

Windows 7是否有任何可以用作替代或替代方式的Windows 7(例如某种插件软件)以相同的方式工作? 换句话说,我可以执行Shift + Click之类的操作,这会使操作系统认为鼠标按钮一直保持按下状态,直到我单击其他位置为止。 像这样:

  • Shift+Click initiates “drag mode” (a MouseDown event)

    Shift + Click启动“拖动模式”(MouseDown事件)
  • Moving the mouse in “drag mode” makes the operating system think the mouse button is still being held down

    在“拖动模式”下移动鼠标会使操作系统认为鼠标按钮仍处于按下状态
  • Clicking again while in “drag mode” initiates a release (a MouseUp event)

    在“拖动模式”下再次单击可启动释放(MouseUp事件)

How do you emulate drag and drop without holding the mouse button down?

在不按住鼠标键的情况下如何模拟拖放?

答案 (The Answer)

SuperUser contributors Keltari and hvd have the answer for us. First up, Keltari:

超级用户贡献者Keltari和hvd为我们提供了答案。 首先,Keltari:

Windows has a ClickLock feature that lets you highlight or drag items without continually holding the mouse button down. Go to the Control Panel, then Mouse Properties. Under the Buttons Tab, select Turn on ClickLock.

Windows具有ClickLock功能,可让您突出显示或拖动项目,而无需持续按住鼠标按钮。 转到控制面板 ,然后单击鼠标属性 。 在“ 按钮”选项卡下 ,选择“ 打开ClickLock”

Once the feature is enabled, briefly press down and hold the mouse button for the desired items. To release them, briefly press down and hold the mouse button again. You can even change the length of time the button press needs under Settings once the ClickLock feature has been enabled.

启用该功能后,短暂按下并按住鼠标按钮以找到所需的项目。 要释放它们,请短暂按下并再次按住鼠标按钮。 启用ClickLock功能后,您甚至可以在“设置”下更改按钮按下所需的时间。

c# 模拟 鼠标按住不放_如何在不按住鼠标键的情况下模拟拖放?

Followed by the answer from hvd:

紧接着是hvd的回答:

As an alternative to the other answers posted, you can turn on Mouse Keys. Mouse Keys lets you use the numeric keypad to control the mouse pointer and buttons. You can combine this with a real mouse or track pad so that you use the keypad to control the buttons, but a mouse or track pad to control positioning.

作为发布其他答案的替代方法,您可以打开鼠标键鼠标键使您可以使用数字键盘来控制鼠标指针和按钮。 您可以将其与真正的鼠标或触控板结合使用,以便使用键盘来控制按钮,而使用鼠标或触控板来控制位置。

Alt+Shift+NumLock will open a dialog box asking if you want to turn on Mouse Keys. Once enabled, the numeric keypad’s / (forward slash) and (dash) keys can be used to switch between the left and right mouse button, or * (star) for both. 0 (zero) will press and hold the mouse button and . (decimal) will release it.

Alt + Shift + NumLock将打开一个对话框,询问您是否要打开鼠标键 。 启用后,数字小键盘的/ (正斜杠)和 (破折号)键可用于在鼠标左键和右键之间切换,或使用* (星号)切换。 0 (零)将按住鼠标按钮和 (十进制)将释放它。



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/269070/how-do-you-emulate-drag-and-drop-without-holding-the-mouse-button-down/

c# 模拟 鼠标按住不放