# LoongKeys
**Repository Path**: blue2015/LoongKeys
## Basic Information
- **Project Name**: LoongKeys
- **Description**: No description available
- **Primary Language**: C#
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-06-21
- **Last Updated**: 2021-06-21
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# LoongKeys
WPF版的键盘指示器
A WPF application of low-level keyboard hook(or keyboard indicator/monitor,
use **NONE 3rd party dependency** and **NONE Nuget**)
# 如果你懂中文
在B站搜索 **香辣恐龙蛋** 有本项目完整的开发过程
https://www.bilibili.com/video/av89450038/
# If you can not read chinese
The comment of this project was almost written in both 中文 and English
# The core: keyboard hook(核心的键盘输入程序)
It class relationship is easy to learn.
You can inherit from the **BaseLobalListenner** to creat your own
mouse listener i did not implemetn yet.

# How to use
You can refer to my WPF solution
**LoongEgg.LoongKeys\ViewModels\MainContentViewModel.cs**

```c#
///
/// 全局键盘监控器
///
readonly GlobalKeyboardListener listenerOnKeyboard;// step1: insert a listener into you VIEW MODEL
///
/// The Constructor of
///
public MainContentViewModel()
{
listenerOnKeyboard = new GlobalKeyboardListener();// step2: initialize the listener
listenerOnKeyboard.SetHook();// step3:let the hool start work
listenerOnKeyboard.GlobalKeyboardInputEvent += GlobalKeyboard_InputEvent;// step4:register a event handler
}
///
/// Raised when a keybord input happen
///
///
/// The
///
///
/// A Event Args Defined in name space
///
private void GlobalKeyboard_InputEvent(object sender, GlobalKeyboardInputEventArgs e)
{
// step5: your logical
}
```
# Enjoy it!