This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Keyboard | |
{ | |
public void Send(ScanCodeShort a) | |
{ | |
INPUT[] Inputs = new INPUT[1]; | |
INPUT Input = new INPUT(); | |
Input.type = 1; // 1 = Keyboard Input | |
Input.U.ki.wScan = a; | |
Input.U.ki.dwFlags = KEYEVENTF.SCANCODE; | |
Inputs[0] = Input; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ExtensionMethods { | |
public static string ToHex(this byte[] data) { | |
return ToHex(data, ""); | |
} | |
public static string ToHex(this byte[] data, string prefix) { | |
char[] lookup = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; | |
int i = 0, p = prefix.Length, l = data.Length; | |
char[] c = new char[l * 2 + p]; | |
byte d; | |
for(; i < p; ++i) c[i] = prefix[i]; |
NewerOlder