#ifndef __ROCCAT_KEY_TRANSLATIONS_H__
#define __ROCCAT_KEY_TRANSLATIONS_H__

/*
 * This file is part of roccat-tools.
 *
 * roccat-tools 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 2 of the License, or
 * (at your option) any later version.
 *
 * roccat-tools 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 roccat-tools. If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>

G_BEGIN_DECLS

/*!
 * Conversions happen between following types:
 *
 * - hid usage id
 *   the type stored in macros
 * - keyboard/button keycode
 *   is used by kernel code (evdev events)
 * - xkeycode
 *   means hardware keycode as defined by \c GdkEventKey
 *   hid <--> kbd_keycode <--> xkeycode --> keyval --> keyname
 */

/*!
 * \brief determines if hid usage id is a mouse button
 *
 * Roccat encodes mouse buttons in macro keystroke keys in upper invalid range
 * of hid usage ids.
 *
 * \retval \c TRUE if usage id is a mouse button
 */
gboolean roccat_hid_is_mouse_button(guint8 usage_id);

/*!
 * \brief converts hid usage id to button keycode
 *
 * Uses the values defined in linux/input.h.
 *
 * \retval button keycode
 */
guint roccat_hid_to_btn_keycode(guint8 usage_id);

/*!
 * \brief converts hid usage id to keyboard keycode
 *
 * Uses the same table as linux kernel.
 *
 * \retval keyboard keycode
 */
guint roccat_hid_to_kbd_keycode(guint8 usage_id);

/*!
 * \brief converts xkeycode to hid usage id
 * \retval hid usage id
 */
guint8 roccat_xkeycode_to_hid(guint16 xkeycode);

/*!
 * \brief converts hid usage id to xkeycode
 * \retval xkeycode
 */
guint16 roccat_hid_to_xkeycode(guint8 usage_id);

G_END_DECLS

#endif
