Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Runtime.InteropServices;
- namespace ConsoleApplication3
- {
- class Program
- {
- [DllImport("user32.dll")]
- public static extern short GetAsyncKeyState(int vKey);
- static void Main(string[] args)
- {
- Console.Title = "C# External - Hotkeye";
- while (true)
- {
- for (int i = 0; i < 255; i++)
- {
- if (GetAsyncKeyState(i) != 0)
- {
- Console.WriteLine("Hotkey: 0x" + i.ToString("X"));
- }
- }
- System.Threading.Thread.Sleep(1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment