#include <stdlib.h>
#include <limits.h>
-#include <search.h>
+#ifdef HAVE_SEARCH_H
+# include <search.h>
+#endif
#include <vlc_common.h>
#include <vlc_keys.h>
* Parse a human-readable string representation of a VLC key code.
* @return a VLC key code, or KEY_UNSET on failure.
*/
-static
uint_fast32_t vlc_str2keycode (const char *name)
{
uint_fast32_t mods = 0;
struct action
{
char name[MAXACTION];
- vlc_key_t value;
+ vlc_action_t value;
};
static const struct action actions[] =
{ "faster", ACTIONID_FASTER, },
{ "frame-next", ACTIONID_FRAME_NEXT, },
{ "incr-scalefactor", ACTIONID_SCALE_UP, },
- { "intf-hide", ACTIONID_INTF_HIDE, },
- { "intf-show", ACTIONID_INTF_SHOW, },
+ { "intf-boss", ACTIONID_INTF_BOSS, },
+ { "intf-show", ACTIONID_INTF_TOGGLE_FSC, },
{ "jump+extrashort", ACTIONID_JUMP_FORWARD_EXTRASHORT, },
{ "jump+long", ACTIONID_JUMP_FORWARD_LONG, },
{ "jump+medium", ACTIONID_JUMP_FORWARD_MEDIUM, },
struct mapping
{
- uint32_t key; ///< Key code
- vlc_key_t action; ///< Action ID
+ uint32_t key; ///< Key code
+ vlc_action_t action; ///< Action ID
};
static int keycmp (const void *a, const void *b)
return var_SetInteger (obj, "key-action", (*pent)->action);
}
-
+/**
+ * Sets up all key mappings for a given action.
+ * \param map tree (of struct mapping entries) to write mappings to
+ * \param confname VLC configuration item to read mappings from
+ * \param action action ID
+ */
static void vlc_MapAction (vlc_object_t *obj, void **map,
- const char *confname, vlc_key_t action)
+ const char *confname, vlc_action_t action)
{
char *keys = var_InheritString (obj, confname);
if (keys == NULL)
}
#endif
keys->psz_action = actions[i].name;
- keys->i_action = actions[i].value;
keys++;
char name[12 + MAXACTION];
}
keys->psz_action = NULL;
- keys->i_action = 0;
libvlc->p_hotkeys = as->keys;
var_AddCallback (obj, "key-pressed", vlc_key_to_action, &as->map);
* Get the action ID from the action name in the configuration subsystem.
* @return the action ID or ACTIONID_NONE on error.
*/
-vlc_key_t vlc_GetActionId(const char *name)
+vlc_action_t vlc_GetActionId (const char *name)
{
const struct action *act;