Skip to content

Commit 1a6963e

Browse files
feat: adding global keyboard listener
we will need this to skip messages and things
1 parent db7eddd commit 1a6963e

File tree

9 files changed

+1174
-21
lines changed

9 files changed

+1174
-21
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
4+
namespace TwitchStreamingTools.Models;
5+
6+
/// <summary>
7+
/// The structure representing the key pressed.
8+
/// </summary>
9+
[StructLayout(LayoutKind.Sequential)]
10+
internal struct KeyboardLowLevelHookStruct {
11+
/// <summary>
12+
/// The keystroke.
13+
/// </summary>
14+
public int vkCode;
15+
16+
/// <summary>
17+
/// The scan code.
18+
/// </summary>
19+
public int scanCode;
20+
21+
/// <summary>
22+
/// The flags.
23+
/// </summary>
24+
public int flags;
25+
26+
/// <summary>
27+
/// The time the key was pressed.
28+
/// </summary>
29+
public int time;
30+
31+
/// <summary>
32+
/// The extra info.
33+
/// </summary>
34+
public IntPtr dwExtraInfo;
35+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
namespace TwitchStreamingTools.Models;
2+
3+
/// <summary>
4+
/// Information on what kind of event it is.
5+
/// </summary>
6+
public enum KeyboardMessage {
7+
/// <summary>
8+
/// The key was pressed down.
9+
/// </summary>
10+
KEY_DOWN = 0x100,
11+
12+
/// <summary>
13+
/// The key was released after being pressed down.
14+
/// </summary>
15+
KEY_UP = 0x101,
16+
17+
/// <summary>
18+
/// No idea.
19+
/// </summary>
20+
SYS_KEY_DOWN = 0x104,
21+
22+
/// <summary>
23+
/// Don't ask me.
24+
/// </summary>
25+
SYS_KEY_UP = 0x105
26+
}

0 commit comments

Comments
 (0)