如何在.NET中交换左右鼠标按钮(最好是C#)?基本上结果应该与用户通过控制面板选中鼠标属性中的"切换主按钮和辅助按钮"复选框相同.我正在处理Windows XP,以防万一.
Joh*_*lla 13
您可以使用Windows API调用SwapMouseButton:
using System.Runtime.InteropServices;
// ...
[DllImport("user32.dll")]
public static extern Int32 SwapMouseButton(Int32 bSwap);
// ...
// Swap it.
SwapMouseButton(1);
// Back to normal.
SwapMouseButton(0);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4408 次 |
| 最近记录: |