/* * Copyright (C) 2018 Ortega Froysa, Nicolás * Author: Ortega Froysa, Nicolás * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #pragma once enum { KEY_UP = 0x0, KEY_DOWN = 0x1, KEY_LEFT = 0x2, KEY_RIGHT = 0x3, KEY_RESET = 0x4, KEY_HELP = 0x5, KEY_INFO = 0x6, KEY_FULLSCREEN = 0x7, KEY_MAX = 0x8 }; /** * @brief Initialize the event handler. * * @return 0 upon failure, 1 upon success. */ int evnt_mngr_init(); /** * @brief Deinitialize the event handler. */ void evnt_mngr_deinit(); /** * @brief Handle the next event in the queue (wait if the * queue is empty). */ void handle_event(); /** * @brief Receive state of a key. * * @param code The key code. * * @return If down 1 will be returned, else 0. */ int key_is_down(int code);