From a2f711c1441035f6b4b28c65c9f750ff057ddc42 Mon Sep 17 00:00:00 2001 From: vcaesar Date: Thu, 21 Feb 2019 08:57:48 -0400 Subject: [PATCH] update code style --- hook.go | 27 ++++++++++++++++++--------- hook/iohook.h | 1 + 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/hook.go b/hook.go index 65d59dd..3cdb57f 100644 --- a/hook.go +++ b/hook.go @@ -93,23 +93,32 @@ func (e Event) String() string { case HookDisabled: return fmt.Sprintf("%v - Event: {Kind: HookDisabled}", e.When) case KeyUp: - return fmt.Sprintf("%v - Event: {Kind: KeyUp, Rawcode: %v, Keychar: %v}", e.When, e.Rawcode, e.Keychar) + return fmt.Sprintf("%v - Event: {Kind: KeyUp, Rawcode: %v, Keychar: %v}", + e.When, e.Rawcode, e.Keychar) case KeyHold: - return fmt.Sprintf("%v - Event: {Kind: KeyHold, Rawcode: %v, Keychar: %v}", e.When, e.Rawcode, e.Keychar) + return fmt.Sprintf("%v - Event: {Kind: KeyHold, Rawcode: %v, Keychar: %v}", + e.When, e.Rawcode, e.Keychar) case KeyDown: - return fmt.Sprintf("%v - Event: {Kind: KeyDown, Rawcode: %v, Keychar: %v}", e.When, e.Rawcode, e.Keychar) + return fmt.Sprintf("%v - Event: {Kind: KeyDown, Rawcode: %v, Keychar: %v}", + e.When, e.Rawcode, e.Keychar) case MouseUp: - return fmt.Sprintf("%v - Event: {Kind: MouseUp, Button: %v, X: %v, Y: %v, Clicks: %v}", e.When, e.Button, e.X, e.Y, e.Clicks) + return fmt.Sprintf("%v - Event: {Kind: MouseUp, Button: %v, X: %v, Y: %v, Clicks: %v}", + e.When, e.Button, e.X, e.Y, e.Clicks) case MouseHold: - return fmt.Sprintf("%v - Event: {Kind: MouseHold, Button: %v, X: %v, Y: %v, Clicks: %v}", e.When, e.Button, e.X, e.Y, e.Clicks) + return fmt.Sprintf("%v - Event: {Kind: MouseHold, Button: %v, X: %v, Y: %v, Clicks: %v}", + e.When, e.Button, e.X, e.Y, e.Clicks) case MouseDown: - return fmt.Sprintf("%v - Event: {Kind: MouseDown, Button: %v, X: %v, Y: %v, Clicks: %v}", e.When, e.Button, e.X, e.Y, e.Clicks) + return fmt.Sprintf("%v - Event: {Kind: MouseDown, Button: %v, X: %v, Y: %v, Clicks: %v}", + e.When, e.Button, e.X, e.Y, e.Clicks) case MouseMove: - return fmt.Sprintf("%v - Event: {Kind: MouseMove, Button: %v, X: %v, Y: %v, Clicks: %v}", e.When, e.Button, e.X, e.Y, e.Clicks) + return fmt.Sprintf("%v - Event: {Kind: MouseMove, Button: %v, X: %v, Y: %v, Clicks: %v}", + e.When, e.Button, e.X, e.Y, e.Clicks) case MouseDrag: - return fmt.Sprintf("%v - Event: {Kind: MouseDrag, Button: %v, X: %v, Y: %v, Clicks: %v}", e.When, e.Button, e.X, e.Y, e.Clicks) + return fmt.Sprintf("%v - Event: {Kind: MouseDrag, Button: %v, X: %v, Y: %v, Clicks: %v}", + e.When, e.Button, e.X, e.Y, e.Clicks) case MouseWheel: - return fmt.Sprintf("%v - Event: {Kind: MouseWheel, Amount: %v, Rotation: %v, Direction: %v}", e.When, e.Amount, e.Rotation, e.Direction) + return fmt.Sprintf("%v - Event: {Kind: MouseWheel, Amount: %v, Rotation: %v, Direction: %v}", + e.When, e.Amount, e.Rotation, e.Direction) case FakeEvent: return fmt.Sprintf("%v - Event: {Kind: FakeEvent}", e.When) } diff --git a/hook/iohook.h b/hook/iohook.h index 34a1e94..e135ba6 100644 --- a/hook/iohook.h +++ b/hook/iohook.h @@ -79,6 +79,7 @@ typedef struct _screen_data { typedef struct _keyboard_event_data { uint16_t keycode; uint16_t rawcode; + // uint16_t keychar; uint32_t keychar; // char *keychar; } keyboard_event_data,