[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[系统相关] 【已解决】如何实现切换鼠标左右键的主次?

本帖最后由 pcl_test 于 2016-4-7 23:33 编辑

如果别人用我的电脑,我可以快速切换回正常的左右键,因为我是左撇子。

1

评分人数

去学去写去用才有进步。安装python3代码存为xx.py 双击运行或右键用IDLE打开按F5运行

TOP

RUNDLL32.EXE USER32.DLL,SwapMouseButton

TOP

本帖最后由 ivor 于 2016-4-8 18:35 编辑

Visual C++,运行一次切换一次
  1. #include <Windows.h>
  2. int _tmain(int argc, _TCHAR* argv[])
  3. {
  4. if (SwapMouseButton(TRUE)){
  5. SwapMouseButton(FALSE);
  6. }
  7. return 0;
  8. }
复制代码
回复 3# 虫子樱桃
2

评分人数

#&cls&@powershell "Invoke-Expression ([Io.File]::ReadAllText('%~0',[Text.Encoding]::UTF8))" &pause&exit

TOP

本帖最后由 pcl_test 于 2016-4-8 06:30 编辑
  1. /*&cls
  2. @echo off
  3. set "netpath=%systemroot%\Microsoft.NET\Framework"
  4. for /f "delims=" %%a in ('dir /ad /b "%netpath%\v?.*"') do (
  5.     if exist "%netpath%\%%a\csc.exe" (
  6.         set "cscpath=%netpath%\%%a\csc.exe"
  7.         goto :0
  8.     )
  9. )
  10. echo;未安装.Net Framework 2.0及其以上版本组件或相关程序丢失&pause&exit
  11. :0
  12. "%cscpath%" /out:SwapMouseButton.exe "%~f0"
  13. SwapMouseButton.exe
  14. pause&exit
  15. */
  16. using System;
  17. using System.Runtime.InteropServices;
  18. class Program
  19. {
  20.     //http://blog.csdn.net/bluceyoung/article/details/8582160
  21.     [DllImport("user32.dll")]
  22.     private extern static bool SwapMouseButton(bool fSwap);
  23.     static void Main(string[] args)
  24.     {
  25.         if (SwapMouseButton(true))SwapMouseButton(false);
  26.     }
  27. }
复制代码
1

评分人数

TOP

回复 3# 虫子樱桃

如何切换回来呀

TOP

回复 4# ivor


    已编译上传:http://www.bathome.net/s/tool/?key=SwapMouseButton
2

评分人数

TOP

返回列表