33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
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
|
+
+
+
+
+
+
+
+
+
+
+
+
+
|
running = NO;
}
- (void)keyWasPressed: (OGKKeyPressEvent*)event
display: (OGKDisplay*)display
{
of_log(@"Pressed: %d", event.keycode);
}
- (void)keyWasReleased: (OGKKeyReleaseEvent*)event
display: (OGKDisplay*)display
{
of_log(@"Released: %d", event.keycode);
}
- (void)characterWasTyped: (OGKCharacterTypedEvent*)event
display: (OGKDisplay*)display
{
of_log(@"Character typed: %u (keycode=%d, modifiers=%d, repeated=%d)",
event.character, event.keycode, event.modifiers, event.repeated);
switch (event.keycode) {
case OGK_KEY_R:
tint = ogk_color(1, 0.5, 0.5, 0);
break;
case OGK_KEY_G:
tint = ogk_color(0.5, 1, 0.5, 0);
|
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
-
-
-
-
-
-
|
break;
case OGK_KEY_Q:
running = NO;
break;
}
}
- (void)keyWasReleased: (OGKKeyReleaseEvent*)event
display: (OGKDisplay*)display
{
of_log(@"Released: %d", event.keycode);
}
- (void)mouseWasMoved: (OGKMouseMovedEvent*)event
display: (OGKDisplay*)display
{
of_log(@"Mouse moved: X=%.f(%.f) Y=%.f(%.f) WX=%.f(%.f) WY=%.f(%.f)",
event.cursor.x, event.deltaCursor.x,
event.cursor.y, event.deltaCursor.y,
event.wheel.x, event.deltaWheel.x,
|