Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to comply with latest interception #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Interceptor/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ public void Unload()

private void DriverCallback()
{
InterceptionDriver.SetFilter(context, InterceptionDriver.IsKeyboard, (Int32) KeyboardFilterMode);
InterceptionDriver.SetFilter(context, InterceptionDriver.IsMouse, (Int32) MouseFilterMode);
InterceptionDriver.SetFilter(context, InterceptionDriver.IsKeyboard, (ushort) KeyboardFilterMode);
InterceptionDriver.SetFilter(context, InterceptionDriver.IsMouse, (ushort) MouseFilterMode);

Stroke stroke = new Stroke();

Expand Down Expand Up @@ -128,7 +128,7 @@ private void DriverCallback()
{
if (OnKeyPressed != null)
{
var args = new KeyPressedEventArgs() { Key = stroke.Key.Code, State = stroke.Key.State};
var args = new KeyPressedEventArgs() { Key = stroke.Key.Code, State = stroke.Key.State };
OnKeyPressed(this, args);

if (args.Handled)
Expand Down
20 changes: 15 additions & 5 deletions Interceptor/InterceptionDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public struct MouseStroke
public Int16 Rolling;
public Int32 X;
public Int32 Y;
public UInt16 Information;
public UInt32 Information;
}

[StructLayout(LayoutKind.Sequential)]
Expand Down Expand Up @@ -132,10 +132,10 @@ public static class InterceptionDriver
public static extern void SetPrecedence(IntPtr context, Int32 device, Int32 Precedence);

[DllImport("interception.dll", EntryPoint = "interception_get_filter", CallingConvention = CallingConvention.Cdecl)]
public static extern void GetFilter(IntPtr context, Int32 device);
public static extern ushort GetFilter(IntPtr context, Int32 device);

[DllImport("interception.dll", EntryPoint = "interception_set_filter", CallingConvention = CallingConvention.Cdecl)]
public static extern void SetFilter(IntPtr context, Predicate predicate, Int32 keyboardFilterMode);
public static extern void SetFilter(IntPtr context, Predicate predicate, ushort keyboardFilterMode);

[DllImport("interception.dll", EntryPoint = "interception_wait", CallingConvention = CallingConvention.Cdecl)]
public static extern Int32 Wait(IntPtr context);
Expand All @@ -156,9 +156,19 @@ public static class InterceptionDriver
public static extern Int32 IsInvalid(Int32 device);

[DllImport("interception.dll", EntryPoint = "interception_is_keyboard", CallingConvention = CallingConvention.Cdecl)]
public static extern Int32 IsKeyboard(Int32 device);
private static extern Int32 _IsKeyboard(Int32 device);

public static Int32 IsKeyboard(Int32 device)
{
return _IsKeyboard(device);
}

[DllImport("interception.dll", EntryPoint = "interception_is_mouse", CallingConvention = CallingConvention.Cdecl)]
public static extern Int32 IsMouse(Int32 device);
private static extern Int32 _IsMouse(Int32 device);

public static Int32 IsMouse(Int32 device)
{
return _IsMouse(device);
}
}
}
2 changes: 1 addition & 1 deletion Interceptor/Interceptor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down