No description
  • Rust 51.9%
  • Shell 24.4%
  • Nix 16.8%
  • PowerShell 6.9%
Find a file
2025-02-13 19:40:52 +09:00
src fix: joystick is handled on linux 2025-02-12 01:58:22 +09:00
vendor fix: joystick is handled on linux 2025-02-12 01:58:22 +09:00
.envrc fix: joystick is handled on linux 2025-02-12 01:58:22 +09:00
.gitignore fix: joystick is handled on linux 2025-02-12 01:58:22 +09:00
.gitmodules chore: update skyhook 2023-10-30 02:58:01 +09:00
build.ps1 fix: use gnu target for windows 2023-12-02 12:11:32 +09:00
build.sh feat: use context 2024-01-07 18:51:36 +09:00
Cargo.toml fix: crate type 2023-03-28 19:25:36 +09:00
Cross.toml feat: use cross for linux building 2025-02-13 19:40:52 +09:00
devenv.lock fix: joystick is handled on linux 2025-02-12 01:58:22 +09:00
devenv.nix fix: joystick is handled on linux 2025-02-12 01:58:22 +09:00
devenv.yaml fix: joystick is handled on linux 2025-02-12 01:58:22 +09:00
README.md chore: fix a typo in README 2022-11-26 17:07:00 +09:00
setup-targets.sh chore: add darwin aarch64 target 2022-11-03 23:51:14 +09:00

SkyHook-Native

Dynamic library of SkyHook for use with other languages.

Usage

The following examples are all in C#.

Functions

The extern functions that you should run are simple.

There are just two; start_hook and stop_hook.

start_hook

// Here, we assign a callback along with starting a hook.
// The NativeEvent type is declared below "Types" header.
public static delegate void HookCallback(NativeEvent ev);

// Here, we have an extern method to invoke.
[DllImport("skyhook", EntryPoint = "start_hook")]
public static extern void StartHook(HookCallback callback);

stop_hook

// No additional information required to provide when stopping the hook.
[DllImport("skyhook", EntryPoint = "stop_hook")]
public static extern void StopHook();

Types

NativeEventType

public enum NativeEventType {
    KeyPressed,
    KeyReleased
}

NativeEvent

[StructLayout(LayoutKind.Sequential)]
public struct NativeEvent
{
    public readonly ulong Time; // This is the key state update time.
    public readonly NativeEventType Type; // Whether the key is up or down.
    public readonly ushort Label; // Unified label for keys, such as ESC or F11.
    public readonly ushort Key; // Actual key code from native level.
}

Development

git clone https://git.pikokr.dev/SkyHook/SkyHook-Native #Clone

To build, just run build.sh on Linux or MacOS, build.ps1 on Windows.