-
Notifications
You must be signed in to change notification settings - Fork 24
/
events.go
76 lines (68 loc) · 1.51 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
package fltk
/*
#include "events.h"
*/
import "C"
type MouseButton int
var (
LeftMouse = MouseButton(C.go_FL_LEFT_MOUSE)
MiddleMouse = MouseButton(C.go_FL_MIDDLE_MOUSE)
RightMouse = MouseButton(C.go_FL_RIGHT_MOUSE)
)
func EventType() Event {
return Event(C.go_fltk_event())
}
func EventButton() MouseButton {
return MouseButton(C.go_fltk_event_button())
}
func EventButton1() bool {
return C.go_fltk_event_button1() != 0
}
func EventX() int {
return int(C.go_fltk_event_x())
}
func EventY() int {
return int(C.go_fltk_event_y())
}
func EventXRoot() int {
return int(C.go_fltk_event_x_root())
}
func EventYRoot() int {
return int(C.go_fltk_event_y_root())
}
func EventDX() int {
return int(C.go_fltk_event_dx())
}
func EventDY() int {
return int(C.go_fltk_event_dy())
}
func EventKey() int {
return int(C.go_fltk_event_key())
}
func EventIsClick() bool {
return C.go_fltk_event_is_click() != 0
}
func EventClicks() int {
return int(C.go_fltk_event_clicks())
}
func SetEventClicks(i int) {
C.go_fltk_event_set_clicks(C.int(i))
}
func EventText() string {
return C.GoString(C.go_fltk_event_text())
}
var (
SHIFT = int(C.go_FL_SHIFT)
CAPS_LOCK = int(C.go_FL_CAPS_LOCK)
CTRL = int(C.go_FL_CTRL)
ALT = int(C.go_FL_ALT)
NUM_LOCK = int(C.go_FL_NUM_LOCK)
META = int(C.go_FL_META)
SCROLL_LOCK = int(C.go_FL_SCROLL_LOCK)
BUTTON1 = int(C.go_FL_BUTTON1)
BUTTON2 = int(C.go_FL_BUTTON2)
BUTTON3 = int(C.go_FL_BUTTON3)
)
func EventState() int {
return int(C.go_fltk_event_state())
}