/*****************************************************************************
* Module descriptor
*****************************************************************************/
-vlc_module_begin();
- set_shortname( _("Global Hotkeys") );
- set_category( CAT_INTERFACE );
- set_subcategory( SUBCAT_INTERFACE_HOTKEYS );
- set_description( _("Global Hotkeys interface") );
- set_capability( "interface", 0 );
- set_callbacks( Open, Close );
-vlc_module_end();
+vlc_module_begin()
+ set_shortname( N_("Global Hotkeys") )
+ set_category( CAT_INTERFACE )
+ set_subcategory( SUBCAT_INTERFACE_HOTKEYS )
+ set_description( N_("Global Hotkeys interface") )
+ set_capability( "interface", 0 )
+ set_callbacks( Open, Close )
+vlc_module_end()
struct intf_sys_t
{
vlc_cond_signal( &p_sys->wait );
vlc_mutex_unlock( &p_sys->lock );
- SetWindowLongPtr( p_sys->hotkeyWindow, GWL_WNDPROC,
+ SetWindowLongPtr( p_sys->hotkeyWindow, GWLP_WNDPROC,
(LONG_PTR)WMHOTKEYPROC );
- SetWindowLongPtr( p_sys->hotkeyWindow, GWL_USERDATA,
+ SetWindowLongPtr( p_sys->hotkeyWindow, GWLP_USERDATA,
(LONG_PTR)p_intf );
/* Registering of Hotkeys */
- for( struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
+ for( const struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
p_hotkey->psz_action != NULL;
p_hotkey++ )
{
if( asprintf( &psz_hotkey, "global-%s", p_hotkey->psz_action ) < 0 )
break;
- i_key = config_GetInt( p_intf, psz_hotkey );
+ i_key = var_InheritInteger( p_intf, psz_hotkey );
free( psz_hotkey );
#define HANDLE( key ) case KEY_##key: i_vk = VK_##key; break
#define HANDLE2( key, key2 ) case KEY_##key: i_vk = VK_##key2; break
+#define KEY_SPACE ' '
+
#ifndef VK_VOLUME_DOWN
#define VK_VOLUME_DOWN 0xAE
#define VK_VOLUME_UP 0xAF
DispatchMessage( &message );
/* Unregistering of Hotkeys */
- for( struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
+ for( const struct hotkey *p_hotkey = p_intf->p_libvlc->p_hotkeys;
p_hotkey->psz_action != NULL;
p_hotkey++ )
{
{
case WM_HOTKEY:
{
- int i;
char psz_atomName[40];
- intf_thread_t *p_intf =
- (intf_thread_t*)GetWindowLongPtr( hwnd, GWL_USERDATA );
- struct hotkey *p_hotkeys = p_intf->p_libvlc->p_hotkeys;
+ 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;
- i = GlobalGetAtomNameA(
- wParam, psz_atomName, sizeof( psz_atomName ) );
- if( !i ) return 0;
+ if( !GlobalGetAtomNameA(
+ wParam, psz_atomName, sizeof( psz_atomName ) ) )
+ return 0;
/* search for key associated with VLC */
- for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+ for( int i = 0; p_hotkeys[i].psz_action != NULL; i++ )
{
if( strcmp( p_hotkeys[i].psz_action, psz_atomName ) )
continue;