mirror of
https://github.com/robotn/gohook.git
synced 2024-11-25 05:46:52 +08:00
update code style
This commit is contained in:
parent
2a4d6bbf54
commit
a2f711c144
27
hook.go
27
hook.go
@ -93,23 +93,32 @@ func (e Event) String() string {
|
|||||||
case HookDisabled:
|
case HookDisabled:
|
||||||
return fmt.Sprintf("%v - Event: {Kind: HookDisabled}", e.When)
|
return fmt.Sprintf("%v - Event: {Kind: HookDisabled}", e.When)
|
||||||
case KeyUp:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
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:
|
case FakeEvent:
|
||||||
return fmt.Sprintf("%v - Event: {Kind: FakeEvent}", e.When)
|
return fmt.Sprintf("%v - Event: {Kind: FakeEvent}", e.When)
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,7 @@ typedef struct _screen_data {
|
|||||||
typedef struct _keyboard_event_data {
|
typedef struct _keyboard_event_data {
|
||||||
uint16_t keycode;
|
uint16_t keycode;
|
||||||
uint16_t rawcode;
|
uint16_t rawcode;
|
||||||
|
// uint16_t keychar;
|
||||||
uint32_t keychar;
|
uint32_t keychar;
|
||||||
// char *keychar;
|
// char *keychar;
|
||||||
} keyboard_event_data,
|
} keyboard_event_data,
|
||||||
|
Loading…
Reference in New Issue
Block a user