C#记录有向图和三字图中的击键时间 [英] C# record keystroke timings in digraph and trigraph
问题描述
我想构建一个简单的C#窗体应用程序,它可以计算有向图的第一个和第二个向下键之间的持续时间。并且第二个和第三个key之间的持续时间三角形用于写入文本框中的数据
KeyDown - H时间戳20:21:39.11
KeyPress - h时间戳20:21:39.14
KeyUp - H时间戳20:21:39.93
KeyDown - E时间戳20:21:39.269
KeyPress - 时间戳20:21:39.274
KeyUp - E时间戳20:21:39.377
KeyDown - Y时间戳20:21:47.247
KeyPress - 时间戳20:21:47.254
KeyUp - Y时间戳20:21:47.397
有谁能告诉我如何捕获这些信息?
提前致谢
I want to build a simple C# windows form application it can compute The duration between the 1st and 2nd down keys of digraph. And The duration between the 2nd and third keyDown of trigraph for data written in a text box
KeyDown - H timestamp 20:21:39.11
KeyPress - h timestamp 20:21:39.14
KeyUp - H timestamp 20:21:39.93
KeyDown - E timestamp 20:21:39.269
KeyPress - e timestamp 20:21:39.274
KeyUp - E timestamp 20:21:39.377
KeyDown - Y timestamp 20:21:47.247
KeyPress - y timestamp 20:21:47.254
KeyUp - Y timestamp 20:21:47.397
Could anyone tell me how to capture this information?
Thanks in advance
推荐答案
仍然是一个非常不明确的问题。要测量持续时间,请使用类System.Diagnostics.Stopwatch
,持续时间 - 结构System.TimeSpan
:
http:// msdn。 microsoft.com/en-us/library/system.diagnostics.stopwatch%28v=vs.110%29.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.timespan(ⅴ = vs.110).aspx [ ^ ]。
-SA
Still a very unclear question. For measuring durations, use the classSystem.Diagnostics.Stopwatch
, for durations — the structureSystem.TimeSpan
:
http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch%28v=vs.110%29.aspx[^],
http://msdn.microsoft.com/en-us/library/system.timespan(v=vs.110).aspx[^].
—SA
这篇关于C#记录有向图和三字图中的击键时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!