【问题标题】:Configuring Windows (10) mouse key settings with commands?使用命令配置 Windows (10) 鼠标键设置?
【发布时间】:2017-01-26 18:30:35
【问题描述】:

你好,

我希望能够即时更改我的 Windows 鼠标键设置。 为了实现这一点,我认为使用批处理文件(或其他任何东西,显然不必是批处理文件)运行的一些命令将是可能的(?)。 我可以轻松地编写一个批处理文件,只需按下键盘上的按钮即可运行。

有谁知道我是否/如何在不实际打开轻松访问中心并去那里的情况下配置我的鼠标键设置? 我主要要改变的是:

非常感谢任何回复,请记住,不必完全按照我所说的那样,我只是想要一种方法来实现这一点。 我愿意接受任何选择,谢谢。

【问题讨论】:

标签: windows batch-file configuration command


【解决方案1】:

制作一个可以调用 swapmouse.cs 的文本文件,其中包含:

using System.Runtime.InteropServices;
using System;

class SwapMouse
{
    [DllImport("user32.dll")]
    public static extern Int32 SwapMouseButton(Int32 bSwap);

    static void Main(string[] args)
    {
        int rightButtonIsAlreadyPrimary = SwapMouseButton(1);
        if (rightButtonIsAlreadyPrimary != 0)
        {
            SwapMouseButton(0);  // Make the left mousebutton primary
        }
    }
}

并在终端窗口中使用此命令将其编译为 swapmouse.exe:

"%SystemRoot%\Microsoft.NET\Framework64\v3.5\csc" swapmouse.cs

运行.exe文件即可,如果要恢复原状,再次运行.exe文件即可。

【讨论】:

    猜你喜欢
    • 2020-01-16
    • 2021-04-05
    • 2015-01-28
    • 2015-10-29
    • 2012-09-01
    • 1970-01-01
    • 2017-05-07
    • 1970-01-01
    相关资源
    最近更新 更多