]> git.sesse.net Git - vlc/commitdiff
Win32: use vlc_GetActionId
authorRémi Denis-Courmont <remi@remlab.net>
Sat, 12 Feb 2011 21:54:29 +0000 (23:54 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 12 Feb 2011 21:57:34 +0000 (23:57 +0200)
modules/control/globalhotkeys/win32.c

index 8e3aeafbf5b4b228e3556c7f4164a684d068e468..f3d78cbf793ef664c92b6a707c653e475d89aa94 100644 (file)
@@ -296,21 +296,17 @@ LRESULT CALLBACK WMHOTKEYPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
 
                 LONG_PTR ret = GetWindowLongPtr( hwnd, GWLP_USERDATA );
                 intf_thread_t *p_intf = (intf_thread_t*)ret;
-                const struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
 
                 if( !GlobalGetAtomNameA(
                         wParam, psz_atomName, sizeof( psz_atomName ) ) )
                     return 0;
 
                 /* search for key associated with VLC */
-                for( int i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+                vlc_key_t action = vlc_GetActionId( psz_atomName );
+                if( action != ACTIONID_NONE )
                 {
-                    if( strcmp( p_hotkeys[i].psz_action, psz_atomName ) )
-                        continue;
-
                     var_SetInteger( p_intf->p_libvlc,
-                            "key-action", p_hotkeys[i].i_action );
-
+                            "key-action", action );
                     return 1;
                 }
             }