forked from HACKERALERT/giu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Events.go
83 lines (66 loc) · 2.24 KB
/
Events.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
package giu
import "github.com/Picocrypt/imgui-go"
type MouseButton int
const (
MouseButtonLeft MouseButton = 0
MouseButtonRight MouseButton = 1
MouseButtonMiddle MouseButton = 2
)
func IsItemHovered() bool {
return imgui.IsItemHovered()
}
// IsItemClicked returns true if mouse is clicked
// NOTE: if you're looking for clicking detection, see EventHandler.go
func IsItemClicked(mouseButton MouseButton) bool {
return imgui.IsItemClicked(int(mouseButton))
}
// IsItemActive returns true if item is active
func IsItemActive() bool {
return imgui.IsItemActive()
}
// IsKeyDown returns true if key `key` is down
func IsKeyDown(key Key) bool {
return imgui.IsKeyDown(int(key))
}
// IsKeyPressed returns true if key `key` is pressed
func IsKeyPressed(key Key) bool {
return imgui.IsKeyPressed(int(key))
}
// IsKeyReleased returns true if key `key` is released
func IsKeyReleased(key Key) bool {
return imgui.IsKeyReleased(int(key))
}
// IsMouseDown returns true if mouse button `button` is down
func IsMouseDown(button MouseButton) bool {
return imgui.IsMouseDown(int(button))
}
// IsMouseClicked returns true if mouse button `button` is clicked
// NOTE: if you're looking for clicking detection, see EventHandler.go
func IsMouseClicked(button MouseButton) bool {
return imgui.IsMouseClicked(int(button))
}
// IsMouseReleased returns true if mouse button `button` is released
func IsMouseReleased(button MouseButton) bool {
return imgui.IsMouseReleased(int(button))
}
// IsMouseDoubleClicked returns true if mouse button `button` is double clicked
func IsMouseDoubleClicked(button MouseButton) bool {
return imgui.IsMouseDoubleClicked(int(button))
}
// IsWindowAppearing returns true if window is appearing
func IsWindowAppearing() bool {
return imgui.IsWindowAppearing()
}
// IsWindowCollapsed returns true if window is disappearing
func IsWindowCollapsed() bool {
return imgui.IsWindowCollapsed()
}
// IsWindowFocused returns true if window is focused
// NOTE: see also (*Window).HasFocus and (*Window).BringToFront
func IsWindowFocused(flags FocusedFlags) bool {
return imgui.IsWindowFocused(int(flags))
}
// IsWindowHovered returns true if the window is hovered
func IsWindowHovered(flags HoveredFlags) bool {
return imgui.IsWindowHovered(int(flags))
}