Compare commits
2 Commits
70ef060deb
...
06c8380a64
Author | SHA1 | Date | |
---|---|---|---|
06c8380a64 | |||
948c5b3b88 |
21
csharp snippets/logkeys.cs
Normal file
21
csharp snippets/logkeys.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
[DllImport("user32.dll")]
|
||||||
|
public static extern int GetAsyncKeyState(Int32 i);
|
||||||
|
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
Thread.Sleep(100);
|
||||||
|
|
||||||
|
for (int i = 0; i < 255; i++)
|
||||||
|
{
|
||||||
|
int keyState = GetAsyncKeyState(i);
|
||||||
|
// 32769 should be used for windows 10.
|
||||||
|
if (keyState == 1 || keyState == -32767 || keyState == 32769)
|
||||||
|
{
|
||||||
|
Console.WriteLine((char)i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user