From cfc16a18d1d0bfcceead6c679e6b99b06dcee68d Mon Sep 17 00:00:00 2001 From: vCaesar Date: Sun, 15 Jan 2017 16:13:05 +0800 Subject: [PATCH] Update and fmt event --- event/hook/darwin/event_c.h | 4 ++-- event/hook/darwin/hook_c.h | 10 +++++----- event/hook/darwin/input.h | 4 ++-- event/hook/darwin/input_c.h | 9 ++++----- event/hook/iohook.h | 1 - event/hook/logger.h | 1 - event/hook/logger_c.h | 5 ++--- event/hook/windows/event_c.h | 2 +- event/hook/windows/hook_c.h | 4 ++-- event/hook/windows/input.h | 2 +- event/hook/windows/input_c.h | 6 +++--- event/hook/windows/properties_c.h | 10 ++++------ event/hook/x11/input.h | 6 +++--- 13 files changed, 29 insertions(+), 35 deletions(-) diff --git a/event/hook/darwin/event_c.h b/event/hook/darwin/event_c.h index 8efefdd..c621b71 100644 --- a/event/hook/darwin/event_c.h +++ b/event/hook/darwin/event_c.h @@ -1,6 +1,6 @@ #ifdef HAVE_CONFIG_H -#include + #include #endif #include @@ -9,8 +9,8 @@ #include #include "../iohook.h" -#include "input.h" // #include "../logger_c.h" +#include "input.h" // TODO Possibly relocate to input helper. static inline CGEventFlags get_key_event_mask(iohook_event * const event) { diff --git a/event/hook/darwin/hook_c.h b/event/hook/darwin/hook_c.h index f2bf6c4..cb8b609 100644 --- a/event/hook/darwin/hook_c.h +++ b/event/hook/darwin/hook_c.h @@ -4,20 +4,20 @@ #endif #ifndef USE_WEAK_IMPORT -#include + #include #endif #include #ifdef USE_OBJC -#include -#include + #include + #include #endif + #include #include #include #include "../iohook.h" - -#include "input.h" // #include "../logger_c.h" +#include "input.h" typedef struct _hook_info { CFMachPortRef port; diff --git a/event/hook/darwin/input.h b/event/hook/darwin/input.h index 699e112..23977e5 100644 --- a/event/hook/darwin/input.h +++ b/event/hook/darwin/input.h @@ -5,7 +5,7 @@ #include #include // For HIToolbox kVK_ keycodes and TIS funcitons. #ifdef USE_IOKIT -#include + #include #endif #include @@ -27,7 +27,7 @@ */ // #define NX_KEYTYPE_CAPS_LOCK 0x04 -//#define NX_KEYTYPE_HELP 0x05 +// #define NX_KEYTYPE_HELP 0x05 // #define NX_POWER_KEY 0x06 // #define NX_KEYTYPE_EJECT 0x0E diff --git a/event/hook/darwin/input_c.h b/event/hook/darwin/input_c.h index 22bf4b0..298f67f 100644 --- a/event/hook/darwin/input_c.h +++ b/event/hook/darwin/input_c.h @@ -4,16 +4,15 @@ #endif #ifdef USE_COREFOUNDATION -#include + #include #endif #ifndef USE_WEAK_IMPORT -#include + #include #endif + #include - -#include "../iohook.h" - #include "input.h" +#include "../iohook.h" #include "../logger_c.h" // Current dead key state. diff --git a/event/hook/iohook.h b/event/hook/iohook.h index a8c557e..db0ba8b 100644 --- a/event/hook/iohook.h +++ b/event/hook/iohook.h @@ -3,7 +3,6 @@ #define __IOHOOK_H // #include "../../base/os.h" - #include #include #include diff --git a/event/hook/logger.h b/event/hook/logger.h index 65c60e1..0314e0f 100644 --- a/event/hook/logger.h +++ b/event/hook/logger.h @@ -2,7 +2,6 @@ #ifndef _included_logger #define _included_logger -// #include #include "iohook.h" #include diff --git a/event/hook/logger_c.h b/event/hook/logger_c.h index 13ad22d..ccc16ed 100644 --- a/event/hook/logger_c.h +++ b/event/hook/logger_c.h @@ -1,15 +1,14 @@ #ifdef HAVE_CONFIG_H -#include + #include #endif #include #include #include #include -// #include -#include "iohook.h" +#include "iohook.h" #include "logger.h" static bool default_logger(unsigned int level, const char *format, ...) { diff --git a/event/hook/windows/event_c.h b/event/hook/windows/event_c.h index 9129574..2eb51f6 100644 --- a/event/hook/windows/event_c.h +++ b/event/hook/windows/event_c.h @@ -7,8 +7,8 @@ #include "../iohook.h" #include -#include "input.h" // #include "logger.h" +#include "input.h" // Some buggy versions of MinGW and MSys do not include these constants in winuser.h. #ifndef MAPVK_VK_TO_VSC diff --git a/event/hook/windows/hook_c.h b/event/hook/windows/hook_c.h index baaacf3..ed15515 100644 --- a/event/hook/windows/hook_c.h +++ b/event/hook/windows/hook_c.h @@ -1,12 +1,12 @@ #ifdef HAVE_CONFIG_H -#include + #include #endif #include -#include "../iohook.h" #include +#include "../iohook.h" #include "input.h" // #include "logger.h" diff --git a/event/hook/windows/input.h b/event/hook/windows/input.h index 56d3577..6ba9817 100644 --- a/event/hook/windows/input.h +++ b/event/hook/windows/input.h @@ -1,5 +1,5 @@ /*********************************************************************** - + Input ***********************************************************************/ #ifndef _included_input_helper diff --git a/event/hook/windows/input_c.h b/event/hook/windows/input_c.h index 0bc79c6..f061b1b 100644 --- a/event/hook/windows/input_c.h +++ b/event/hook/windows/input_c.h @@ -1,6 +1,6 @@ #ifdef HAVE_CONFIG_H -#include + #include #endif #include @@ -8,9 +8,9 @@ #include #include #include -#include "../iohook.h" #include +#include "../iohook.h" #include "../logger_c.h" #include "input.h" @@ -593,7 +593,7 @@ static int refresh_locale_list() { SIZE_T keycode_to_unicode(DWORD keycode, PWCHAR buffer, SIZE_T size) { // Get the thread id that currently has focus and ask for its current - // locale.. + // locale. DWORD focus_pid = GetWindowThreadProcessId(GetForegroundWindow(), NULL); HKL locale_id = GetKeyboardLayout(focus_pid); diff --git a/event/hook/windows/properties_c.h b/event/hook/windows/properties_c.h index 2ea8cd2..3c8ea2b 100644 --- a/event/hook/windows/properties_c.h +++ b/event/hook/windows/properties_c.h @@ -1,13 +1,12 @@ #ifdef HAVE_CONFIG_H -#include + #include #endif -#include "../iohook.h" #include - -// #include "logger.h" +#include "../iohook.h" #include "input.h" +// #include "logger.h" // The handle to the DLL module pulled in DllMain on DLL_PROCESS_ATTACH. HINSTANCE hInst; @@ -89,8 +88,7 @@ IOHOOK_API screen_data* hook_create_screen_info(unsigned char *count) { }; } } - } - else { + } else { // Populate the count. *count = screens.count; } diff --git a/event/hook/x11/input.h b/event/hook/x11/input.h index e309b67..905983f 100644 --- a/event/hook/x11/input.h +++ b/event/hook/x11/input.h @@ -8,9 +8,9 @@ #include #ifdef USE_XKBCOMMON -#include -#include -#include + #include + #include + #include #endif