All-
Had a quick question that I feel is straightforward but I'm missing something basic.
Basically I'm sending key commands using postmessage:
Code:
[DllImport("user32.dll")]
public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, UIntPtr lParam);
public static void KeyDown2(System.Windows.Forms.Keys Key)
{
PostMessage(Memory.MyHandle, WM_KEYDOWN, new IntPtr((int)(Key & Keys.KeyCode)), new UIntPtr(0));
}
public static void KeyUp2(System.Windows.Forms.Keys Key)
{
PostMessage(Memory.MyHandle, WM_KEYUP, new IntPtr((int)(Key & Keys.KeyCode)), new UIntPtr(0));
}
And was wondering how I can convert keys such as [, ], <, >, â, ƒ etc... to the appropriate Key based on the user's keyboard.
Basically I'm traversing the user's bindings + I'm getting hung up on special non 0-9, A-Z characters.
Any help/pointers would be greatly appreciated! I've seen so many posts on stackoverflow and I feel like none are actually relevant to this. It talks about using the KeysConverter class but that doesn't give the correct Keys type back.
This doesn't work:
Code:
KeysConverter kc = new KeysConverter();
Key = (Keys)kc.ConvertFromString("â");
Edit: This is the closest thing I've found, but doesn't seem to account for keyboard differences: http://stackoverflow.com/questions/2...er-to-key-code
Thanks in advance!
~ Tanaris