zoukankan      html  css  js  c++  java
  • C# 鼠标左右手切换

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Runtime.InteropServices;
     
    namespace SwapMouse
    {
        class Program
        {
            [DllImport("user32.dll")]
            private extern static bool SwapMouseButton(bool fSwap);
            //博客地址:http://www.jqpress.com
     
            [DllImport("user32.dll")]
            private extern static int GetSystemMetrics(int index);
     
            static void Main(string[] args)
            {
                int flag = GetSystemMetrics(23);//获取当前鼠标设置状态
                if (flag == 0)//右手习惯
                {
                    SwapMouseButton(true);//设置成左手
                }
                else//左手习惯
                {
                    SwapMouseButton(false);//设置成右手
                }
            }
        }
     
    }
  • 相关阅读:
    提问必备-如何有效的提问?
    通过jdbc驱动连接thriftserver
    在idea上使用springboot构建ssm项目(一)
    二柱子与他的计算题
    JavaScript
    表单格式化
    2020.10.09
    HTML书写规范
    下拉列表框 JComboBox
    用户登录界面
  • 原文地址:https://www.cnblogs.com/sg1991/p/4580068.html
Copyright © 2011-2022 走看看