Skip to content

Commit

Permalink
Register alt key without another key
Browse files Browse the repository at this point in the history
  • Loading branch information
bfritscher committed Jul 14, 2017
1 parent 82bac34 commit 815f75d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Carnac.Logic/KeyMonitor/InterceptKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ static InterceptKeyEventArgs CreateEventArgs(IntPtr wParam, IntPtr lParam)
bool keyUp = wParam == (IntPtr)Win32Methods.WM_KEYUP;
int vkCode = Marshal.ReadInt32(lParam);
var key = (Keys)vkCode;

//http://msdn.microsoft.com/en-us/library/windows/desktop/ms646286(v=vs.85).aspx
if (key != Keys.RMenu && key != Keys.LMenu && wParam == (IntPtr)Win32Methods.WM_SYSKEYDOWN)
{
Expand All @@ -73,6 +74,10 @@ static InterceptKeyEventArgs CreateEventArgs(IntPtr wParam, IntPtr lParam)
alt = true;
keyUp = true;
}
if (wParam == (IntPtr)Win32Methods.WM_SYSKEYDOWN && key == Keys.LMenu)
{
keyDown = true;
}

return new InterceptKeyEventArgs(
key,
Expand Down

0 comments on commit 815f75d

Please sign in to comment.