使用命令配置Windows(10)鼠标键设置?

使用命令配置Windows(10)鼠标键设置?,windows,batch-file,configuration,command,Windows,Batch File,Configuration,Command,你好 我希望能够动态更改我的Windows鼠标键设置。 为了实现这一点,我认为一些命令与批处理文件一起运行(或者其他任何命令,显然不必是批处理文件)是可能的(?)。 我可以很容易地编写一个批处理文件,只需用键盘按一下按钮即可运行 有人知道我是否/如何配置鼠标键设置,而无需实际打开Easy of access center并前往那里吗? 我主要要改变的是: 非常感谢您的回复,请记住,这不一定是我所说的,我只是想找到一种实现这一点的方法。 我可以选择任何选项,谢谢。制作一个文本文件,您可以将其命名

你好

我希望能够动态更改我的Windows鼠标键设置。 为了实现这一点,我认为一些命令与批处理文件一起运行(或者其他任何命令,显然不必是批处理文件)是可能的(?)。 我可以很容易地编写一个批处理文件,只需用键盘按一下按钮即可运行

有人知道我是否/如何配置鼠标键设置,而无需实际打开Easy of access center并前往那里吗? 我主要要改变的是:

非常感谢您的回复,请记住,这不一定是我所说的,我只是想找到一种实现这一点的方法。
我可以选择任何选项,谢谢。

制作一个文本文件,您可以将其命名为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文件。

制作一个可调用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文件。

检查并感谢@npocmaka,我将在可能的情况下仔细查看这些文件。此外,我还发现:如果比我聪明的人能看一看,告诉我这是否是我可以用来实现目标的东西,我将不胜感激。检查并感谢@npocmaka,我会在可能的时候仔细看看。此外,我还发现:如果比我聪明的人能看一看,告诉我这是否是我可以用来实现目标的东西,我将不胜感激。