zoukankan      html  css  js  c++  java
  • 键盘测试工具

    今天买了个二手机械键盘,自己写了个键盘测试工具。

    不是很精致,无需安装,简单实用。

    WPF项目 附代码:

    public MainWindow()
            {
                this.InitializeComponent();
                EventManager.RegisterClassHandler(typeof(Window),
                Keyboard.KeyUpEvent, new KeyEventHandler(Soc_KeyDown), true);
            }
    
            private void Clear_Click(object sender, RoutedEventArgs e)
            {
                txb_history.Text = "";
                txt_thiskey.Text = "";
            }
    
            private void Soc_KeyDown(object sender, KeyEventArgs e)
            {
                Key k = e.Key;
                string Ks = k.ToString();
                if (k == Key.System)
                {
                    Ks = "F10";
                }
                txt_thiskey.Text = Ks;
                string history = "";
                if (txb_history.Text != "")
                {
                    history = txb_history.Text + ",";
                }
                history += Ks;
                List<String> KeyList = history.Split(',').ToList();
                if (KeyList.Count > 10)
                {
                    KeyList.RemoveAt(0);
                }
                history = "";
                foreach (var key in KeyList)
                {
                    history += key + ",";
                }
    
                history = history.Substring(0, history.Length - 1);
    
    
                txb_history.Text = history;
    
            }

    百度网盘:http://pan.baidu.com/s/1dDzVuIt

  • 相关阅读:
    Python去掉字符串中空格的方法
    python:list
    python3元组
    定时任务cron
    python字典:(Dictionary)操作详解
    SQL语句-基础
    linux免密码登陆
    linux开机故障解决方法
    您应升级到 MySQL 5.5.0 或更高版本。 phpmyadmin
    mysql忘记密码
  • 原文地址:https://www.cnblogs.com/fb208/p/4188344.html
Copyright © 2011-2022 走看看