[vlc-devel] [PATCH] Add hotkey and input event for BluRay pop-up menu

Petri Hintukainen phintuka at users.sourceforge.net
Thu Aug 27 10:07:34 CEST 2015


From: Petri Hintukainen <phintuka at gmail.com>

---
 include/vlc_demux.h        | 1 +
 include/vlc_input.h        | 1 +
 include/vlc_keys.h         | 1 +
 modules/access/bluray.c    | 2 ++
 modules/control/hotkeys.c  | 1 +
 src/config/keys.c          | 1 +
 src/input/control.c        | 1 +
 src/input/input.c          | 2 ++
 src/input/input_internal.h | 1 +
 src/libvlc-module.c        | 6 ++++++
 10 files changed, 17 insertions(+)

diff --git a/include/vlc_demux.h b/include/vlc_demux.h
index e0b4c49..f679517 100644
--- a/include/vlc_demux.h
+++ b/include/vlc_demux.h
@@ -181,6 +181,7 @@ enum demux_query_e
     DEMUX_NAV_DOWN,            /* res=can fail */
     DEMUX_NAV_LEFT,            /* res=can fail */
     DEMUX_NAV_RIGHT,           /* res=can fail */
+    DEMUX_NAV_POPUP,           /* res=can fail */
 };
 
 VLC_API int demux_vaControlHelper( stream_t *, int64_t i_start, int64_t i_end, int64_t i_bitrate, int i_align, int i_query, va_list args );
diff --git a/include/vlc_input.h b/include/vlc_input.h
index bd7f129..1997f4e 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -438,6 +438,7 @@ enum input_query_e
     INPUT_NAV_DOWN,
     INPUT_NAV_LEFT,
     INPUT_NAV_RIGHT,
+    INPUT_NAV_POPUP,
 
     /* Meta datas */
     INPUT_ADD_INFO,   /* arg1= char* arg2= char* arg3=...     res=can fail */
diff --git a/include/vlc_keys.h b/include/vlc_keys.h
index 49edab3..4166b43 100644
--- a/include/vlc_keys.h
+++ b/include/vlc_keys.h
@@ -128,6 +128,7 @@ typedef enum vlc_action {
     ACTIONID_NAV_DOWN,
     ACTIONID_NAV_LEFT,
     ACTIONID_NAV_RIGHT,
+    ACTIONID_NAV_POPUP,
     ACTIONID_JUMP_BACKWARD_EXTRASHORT,
     ACTIONID_JUMP_FORWARD_EXTRASHORT,
     ACTIONID_JUMP_BACKWARD_SHORT,
diff --git a/modules/access/bluray.c b/modules/access/bluray.c
index ce8e4a7..fd6912d 100644
--- a/modules/access/bluray.c
+++ b/modules/access/bluray.c
@@ -1478,6 +1478,8 @@ static int blurayControl(demux_t *p_demux, int query, va_list args)
         return sendKeyEvent(p_sys, BD_VK_LEFT);
     case DEMUX_NAV_RIGHT:
         return sendKeyEvent(p_sys, BD_VK_RIGHT);
+    case DEMUX_NAV_POPUP:
+        return sendKeyEvent(p_sys, BD_VK_POPUP);
 
     case DEMUX_CAN_RECORD:
     case DEMUX_GET_FPS:
diff --git a/modules/control/hotkeys.c b/modules/control/hotkeys.c
index f5d0638..118c9c2 100644
--- a/modules/control/hotkeys.c
+++ b/modules/control/hotkeys.c
@@ -771,6 +771,7 @@ static int PutAction( intf_thread_t *p_intf, int i_action )
         case ACTIONID_NAV_DOWN:
         case ACTIONID_NAV_LEFT:
         case ACTIONID_NAV_RIGHT:
+        case ACTIONID_NAV_POPUP:
             if( p_input )
                 input_Control( p_input, i_action - ACTIONID_NAV_ACTIVATE
                                + INPUT_NAV_ACTIVATE, NULL );
diff --git a/src/config/keys.c b/src/config/keys.c
index b247a57..1dcf5a1 100644
--- a/src/config/keys.c
+++ b/src/config/keys.c
@@ -308,6 +308,7 @@ static const struct action actions[] =
     { "nav-left", ACTIONID_NAV_LEFT, },
     { "nav-right", ACTIONID_NAV_RIGHT, },
     { "nav-up", ACTIONID_NAV_UP, },
+    { "nav-popup", ACTIONID_NAV_POPUP, },
     { "next", ACTIONID_NEXT, },
     { "pause", ACTIONID_PAUSE, },
     { "play", ACTIONID_PLAY, },
diff --git a/src/input/control.c b/src/input/control.c
index e498566..3c5173e 100644
--- a/src/input/control.c
+++ b/src/input/control.c
@@ -141,6 +141,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
         case INPUT_NAV_DOWN:
         case INPUT_NAV_LEFT:
         case INPUT_NAV_RIGHT:
+        case INPUT_NAV_POPUP:
             input_ControlPush( p_input, i_query - INPUT_NAV_ACTIVATE
                                + INPUT_CONTROL_NAV_ACTIVATE, NULL );
             return VLC_SUCCESS;
diff --git a/src/input/input.c b/src/input/input.c
index a84be6e..6118356 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -1515,6 +1515,7 @@ static bool ControlIsSeekRequest( int i_type )
     case INPUT_CONTROL_NAV_DOWN:
     case INPUT_CONTROL_NAV_LEFT:
     case INPUT_CONTROL_NAV_RIGHT:
+    case INPUT_CONTROL_NAV_POPUP:
         return true;
     default:
         return false;
@@ -2009,6 +2010,7 @@ static bool Control( input_thread_t *p_input,
         case INPUT_CONTROL_NAV_DOWN:
         case INPUT_CONTROL_NAV_LEFT:
         case INPUT_CONTROL_NAV_RIGHT:
+        case INPUT_CONTROL_NAV_POPUP:
             demux_Control( p_input->p->input.p_demux, i_type
                            - INPUT_CONTROL_NAV_ACTIVATE + DEMUX_NAV_ACTIVATE );
             break;
diff --git a/src/input/input_internal.h b/src/input/input_internal.h
index cf27ff3..e2aa65b 100644
--- a/src/input/input_internal.h
+++ b/src/input/input_internal.h
@@ -198,6 +198,7 @@ enum input_control_e
     INPUT_CONTROL_NAV_DOWN,     // INPUT_NAV_* and DEMUX_NAV_*.
     INPUT_CONTROL_NAV_LEFT,
     INPUT_CONTROL_NAV_RIGHT,
+    INPUT_CONTROL_NAV_POPUP,
 
     INPUT_CONTROL_SET_ES,
     INPUT_CONTROL_RESTART_ES,
diff --git a/src/libvlc-module.c b/src/libvlc-module.c
index 63ff4e0..c0da5a4 100644
--- a/src/libvlc-module.c
+++ b/src/libvlc-module.c
@@ -1246,6 +1246,8 @@ static const char *const mouse_wheel_texts[] = {
 #define NAV_RIGHT_KEY_LONGTEXT N_("Select the key to move the selector right in DVD menus.")
 #define NAV_ACTIVATE_KEY_TEXT N_("Activate")
 #define NAV_ACTIVATE_KEY_LONGTEXT N_("Select the key to activate selected item in DVD menus.")
+#define NAV_POPUP_KEY_TEXT N_("Navigate popup")
+#define NAV_POPUP_KEY_LONGTEXT N_("Select the key to toggle BluRay Pop-Up menu.")
 #define DISC_MENU_TEXT N_("Go to the DVD menu")
 #define DISC_MENU_LONGTEXT N_("Select the key to take you to the DVD menu")
 #define TITLE_PREV_TEXT N_("Select previous DVD title")
@@ -2131,6 +2133,7 @@ vlc_module_begin ()
 #   define KEY_NAV_DOWN           "Down"
 #   define KEY_NAV_LEFT           "Left"
 #   define KEY_NAV_RIGHT          "Right"
+#   define KEY_NAV_POPUP          "Alt+p"
 #   define KEY_QUIT               "Command+q"
 #   define KEY_VOL_UP             "Command+Up"
 #   define KEY_VOL_DOWN           "Command+Down"
@@ -2253,6 +2256,7 @@ vlc_module_begin ()
 #   define KEY_NAV_DOWN           "Down"
 #   define KEY_NAV_LEFT           "Left"
 #   define KEY_NAV_RIGHT          "Right"
+#   define KEY_NAV_POPUP          "Alt+p"
 #   define KEY_QUIT               "Ctrl+q"
 
 #ifdef _WIN32 /* On Windows, people expect volume keys to control the master */
@@ -2408,6 +2412,8 @@ vlc_module_begin ()
              NAV_LEFT_KEY_LONGTEXT, true )
     add_key( "key-nav-right", KEY_NAV_RIGHT, NAV_RIGHT_KEY_TEXT,
              NAV_RIGHT_KEY_LONGTEXT, true )
+    add_key( "key-nav-popup", KEY_NAV_POPUP, NAV_POPUP_KEY_TEXT,
+             NAV_POPUP_KEY_LONGTEXT, true )
 
     add_key( "key-disc-menu", KEY_DISC_MENU, DISC_MENU_TEXT,
              DISC_MENU_LONGTEXT, true )
-- 
2.1.4



More information about the vlc-devel mailing list