mirror of
https://github.com/robotn/gohook.git
synced 2024-11-22 11:36:47 +08:00
add event status and update code style
This commit is contained in:
parent
602a6294ff
commit
f27e2e5265
@ -49,7 +49,7 @@ void dispatch_proc(iohook_event * const event) {
|
||||
snprintf(buffer + length, sizeof(buffer) - length,
|
||||
",keycode=%u,rawcode=0x%X",
|
||||
event->data.keyboard.keycode, event->data.keyboard.rawcode);
|
||||
int akeyCode = (uint16_t) event->data.keyboard.keycode;
|
||||
int key_code = (uint16_t) event->data.keyboard.keycode;
|
||||
|
||||
if (event->data.keyboard.keycode == VC_ESCAPE
|
||||
&& atoi(cevent) == 11) {
|
||||
@ -59,7 +59,7 @@ void dispatch_proc(iohook_event * const event) {
|
||||
}
|
||||
|
||||
// printf("atoi(str)---%d\n", atoi(cevent));
|
||||
if (akeyCode == atoi(cevent)) {
|
||||
if (key_code == atoi(cevent)) {
|
||||
int stopEvent = stop_event();
|
||||
// printf("%d\n", stopEvent);
|
||||
cstatus = 0;
|
||||
|
@ -43,6 +43,7 @@ char *cevent;
|
||||
int rrevent;
|
||||
// uint16_t *cevent;
|
||||
int cstatus = 1;
|
||||
int event_status;
|
||||
|
||||
|
||||
int stop_event();
|
||||
|
Loading…
Reference in New Issue
Block a user