要实现电脑的左右键交换,需要调用系统底层方法,只需要DllImport SwapMouseButton即可
1.注册
[DllImport("user32.dll", EntryPoint = "SwapMouseButton")]
public static extern int SwapMouseButton(int bSwap);
2.调用
左键设右键
SwapMouseButton(1);
恢复如初
SwapMouseButton(0);