Today, I bought a second-hand mechanical keyboard and wrote a keyboard test tool.
Not very delicate, no installation, simple and practical.
WPF Project attached code:
PublicMainWindow () { This. InitializeComponent (); Eventmanager.registerclasshandler (typeof(Window), Keyboard.keyupevent,NewKeyeventhandler (Soc_keydown),true); } Private voidClear_click (Objectsender, RoutedEventArgs e) {txb_history. Text=""; Txt_thiskey. Text=""; } Private voidSoc_keydown (Objectsender, KeyEventArgs e) {Key k=E.key; stringKs =k.tostring (); if(k = =key.system) {Ks="F10"; } txt_thiskey. Text=Ks; stringHistory =""; if(Txb_history. Text! ="") { history= Txb_history. Text +","; } History+=Ks; List<String> keylist = history. Split (','). ToList (); if(Keylist.count >Ten) {keylist.removeat (0); } History=""; foreach(varKeyinchkeylist) { History+ = key +","; } History= history. Substring (0, history. Length-1); Txb_history. Text=History ; }
Baidu Network disk: Http://pan.baidu.com/s/1dDzVuIt
Keyboard Test Tools