VLC_EXPORT( char *, vlc_keycode2str, (uint_fast32_t i_key) ) LIBVLC_USED;
VLC_EXPORT( uint_fast32_t, vlc_str2keycode, (const char *str) ) LIBVLC_USED;
-typedef enum vlc_key {
+typedef enum vlc_action {
ACTIONID_NONE = 0,
ACTIONID_QUIT,
ACTIONID_PLAY_PAUSE,
ACTIONID_RATE_SLOWER_FINE,
ACTIONID_RATE_FASTER_FINE,
-} vlc_key_t;
+} vlc_action_t;
-VLC_EXPORT( vlc_key_t, vlc_GetActionId, (const char *psz_key) ) LIBVLC_USED;
+VLC_EXPORT( vlc_action_t, vlc_GetActionId, (const char *psz_key) ) LIBVLC_USED;
struct hotkey
{
return 0;
/* search for key associated with VLC */
- vlc_key_t action = vlc_GetActionId( psz_atomName );
+ vlc_action_t action = vlc_GetActionId( psz_atomName );
if( action != ACTIONID_NONE )
{
var_SetInteger( p_intf->p_libvlc,
{
if( !strncmp( "key-", c, 4 ) )
{
- vlc_key_t i_key = vlc_GetActionId( c );
+ vlc_action_t i_key = vlc_GetActionId( c );
if( i_key )
var_SetInteger( p_intf->p_libvlc, "key-action", i_key );
else
static int vlclua_action_id( lua_State *L )
{
- vlc_key_t i_key = vlc_GetActionId( luaL_checkstring( L, 1 ) );
+ vlc_action_t i_key = vlc_GetActionId( luaL_checkstring( L, 1 ) );
if (i_key == 0)
return 0;
lua_pushnumber( L, i_key );
struct action
{
char name[MAXACTION];
- vlc_key_t value;
+ vlc_action_t value;
};
static const struct action actions[] =
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)
* 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;
#include "media_player_internal.h"
/*
- * mapping of libvlc_navigate_mode_t to vlc_key_t
+ * mapping of libvlc_navigate_mode_t to vlc_action_t
*/
-static const vlc_key_t libvlc_navigate_to_action[] =
+static const vlc_action_t libvlc_navigate_to_action[] =
{
ACTIONID_NAV_ACTIVATE,
ACTIONID_NAV_UP,