File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 11# jphp-nativehook-ext
2+
23NativeHook for jphp.
4+
5+ ## Install
6+ ```
7+ jppm add nativehook@1.0.4
8+ ```
9+ ## Examples
10+ ``` php
11+ use nativehook\NativeHook;
12+ use nativehook\NativeMouseEvent;
13+ use nativehook\NativeKeyEvent;
14+ use nativehook\NativeMouseWheelEvent;
15+
16+ $hook = new NativeHook;
17+ // mouseUp, mouseDown, mouseClick, mouseMove or mouseDragged
18+ $hook->on('mouseDown', function(NativeMouseEvent $e){
19+ echo "Mouse pressed on {$e->x},{$e->y}\n";
20+ });
21+ // keyUp, keyDown or keyPress
22+ $hook->on('keyUp', function(NativeKeyEvent $e){
23+ echo "Key {$e->key} is released\n";
24+ });
25+ $hook->on('mouseWheel', function(NativeMouseWheelEven $e){
26+ echo "Mouse wheel\n";
27+ });
28+
29+ $hook->start();
30+ ...
31+ $hook->stop();
32+ ```
33+ ## API Documentation
34+ [ api-docs] ( api-docs/ ) .
You can’t perform that action at this time.
0 commit comments