Replies: 3 comments 1 reply
-
AddKeyDown //bool isUseExtendedKey = isExtendedKey == null ? IsExtendedKey(keyCode) : isExtendedKey.Value;
//ushort scanCode = (ushort)User32.MapVirtualKey((ushort)keyCode, User32.MAPVK.MAPVK_VK_TO_VSC_EX);
//User32.INPUT input = new()
//{
// type = User32.INPUTTYPE.INPUT_KEYBOARD,
// ki = new User32.KEYBDINPUT()
// {
// wVk = (ushort)keyCode,
// wScan = scanCode,
// dwFlags = (isUseExtendedKey ? User32.KEYEVENTF.KEYEVENTF_EXTENDEDKEY : 0) | User32.KEYEVENTF.KEYEVENTF_SCANCODE,
// time = 0,
// dwExtraInfo = IntPtr.Zero,
// },
//};
//User32.INPUT item = input;
//_inputList.Add(item);
//return this; AddKeyUp //bool isUseExtendedKey = isExtendedKey == null ? IsExtendedKey(keyCode) : isExtendedKey.Value;
//ushort scanCode = (ushort)User32.MapVirtualKey((ushort)keyCode, User32.MAPVK.MAPVK_VK_TO_VSC_EX);
//User32.INPUT input = new()
//{
// type = User32.INPUTTYPE.INPUT_KEYBOARD,
// ki = new User32.KEYBDINPUT()
// {
// wVk = (ushort)keyCode,
// wScan = scanCode,
// dwFlags = (isUseExtendedKey ? User32.KEYEVENTF.KEYEVENTF_EXTENDEDKEY : 0) | User32.KEYEVENTF.KEYEVENTF_KEYUP | User32.KEYEVENTF.KEYEVENTF_SCANCODE,
// time = 0,
// dwExtraInfo = IntPtr.Zero,
// },
//};
//User32.INPUT item = input;
//_inputList.Add(item);
//return this; |
Beta Was this translation helpful? Give feedback.
0 replies
-
public nint WndProc(nint hWnd, int msg, nint wParam, nint lParam, ref bool handled)
{
if (msg == 256 && wParam.ToInt32() == 13)
{ // WM_KEYDOWN == 256, Enter == 13
Debug.WriteLine(lParam.ToInt32());
if ((lParam.ToInt32() >> 24) == 0)
{
MessageBox.Show("main enter pressed!");
}
else
{
MessageBox.Show("numpad enter pressed!");
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Beta Was this translation helpful? Give feedback.
All reactions