5 void onKeyboardEvent(GLFWwindow* window, int key, int scancode, int action, int mods) {
8 if (action == GLFW_PRESS) {
9 startMovement(DIRECTION_UP);
11 else if (action == GLFW_RELEASE) {
12 stopMovement(DIRECTION_UP);
16 if (action == GLFW_PRESS) {
17 startMovement(DIRECTION_DOWN);
19 else if (action == GLFW_RELEASE) {
20 stopMovement(DIRECTION_DOWN);
24 if (action == GLFW_PRESS) {
25 startMovement(DIRECTION_LEFT);
27 else if (action == GLFW_RELEASE) {
28 stopMovement(DIRECTION_LEFT);
32 if (action == GLFW_PRESS) {
33 startMovement(DIRECTION_RIGHT);
35 else if (action == GLFW_RELEASE) {
36 stopMovement(DIRECTION_RIGHT);