临时切换鼠标左右键
2011-08-24 08:41
239 查看
C#版:
C++版:
很明显两者都是通过调用windows的API。编辑后给EXE文件新建一个快捷方式,如取名为swap(您也可以保留后缀名),把快捷方式拷贝到用户变量定位文件路径下,必要时运行里输入"swap"就OK了。
using System; using System.Collections.Generic; using System.Text; namespace swapMouseButton2 { class Program { private const int SM_SWAPBUTTON = 23; [System.Runtime.InteropServices.DllImport("user32.dll")] private extern static bool SwapMouseButton(bool fSwap); [System.Runtime.InteropServices.DllImport("user32.dll")] private extern static bool GetSystemMetrics(int nIndex); static void Main(string[] args) { SwapMouseButton(!GetSystemMetrics(SM_SWAPBUTTON)); } } }
C++版:
#include <windows.h> #include <stdio.h> int WINAPI WinMain( HINSTANCE hInstance, // handle to current instance HINSTANCE hPrevInstance, // handle to previous instance LPSTR lpCmdLine, // command line int nCmdShow // show state ) { BOOL bSwapped = ::GetSystemMetrics(SM_SWAPBUTTON); ::SwapMouseButton(! bSwapped); return 0; }
很明显两者都是通过调用windows的API。编辑后给EXE文件新建一个快捷方式,如取名为swap(您也可以保留后缀名),把快捷方式拷贝到用户变量定位文件路径下,必要时运行里输入"swap"就OK了。
相关文章推荐
- 一款JS感应鼠标横向左右切换的焦点图切换效果
- Cygwin复制,粘贴 直接用鼠标在黑框上选区即可,选区结束就已经复制了。cygwin里面Ctrl+V是不能粘贴的,用Shfit+ Insert(键盘上下左右方向键的上面) Cygwin 下切换目
- js鼠标点击按钮切换图片-图片自动切换-点击左右按钮切换特效代码
- C#切换鼠标左右键习惯
- iMouse - 快速切换鼠标左右键
- 鼠标点击按钮图片切换+自动切换+左右按钮点击切换效果
- SwapMouseButton切换鼠标左右键
- 切换鼠标左右按键引发的思考(批处理、VBS、DynamicWrapper)
- [Delphi]切换鼠标左右按键
- js鼠标点击按钮切换图片-图片自动切换-点击左右按钮切换特效代码
- 修改系统鼠标左右按键快速切换
- 使用jQuery实现鼠标点击左右按钮滑动切换
- 自动播放,鼠标触发排序切换JS焦点轮播图(不带左右箭头切换)
- 左右切换鼠标可控的无缝图片滚动代码
- JS+CSS控制左右切换鼠标可控的无缝图片滚动代码
- Autohotkey实现快捷键切换鼠标左右手设置
- Android 仿365日历支持左右切换月份上下收缩
- 仿照Launcher的Workspace实现左右滑动切换(下)
- JS------鼠标hover动作,显示与隐藏的切换