+
+ case CONFIG_ITEM_KEY:
+ {
+ int i;
+ char *psz_duptip = NULL;
+ VLCComboBox *o_combo_box;
+
+ if ( p_item->psz_longtext != NULL )
+ psz_duptip = strdup( p_item->psz_longtext );
+
+ s_rc.origin.y += 10;
+ s_rc.size.width = - 10;
+ s_rc.size.height = 20;
+ CHECK_VIEW_HEIGHT;
+ CONTROL_LABEL( p_item->psz_text );
+ s_rc.origin.x = X_ORIGIN;
+ s_rc.origin.y += s_rc.size.height;
+ s_rc.size.width = s_vrc.size.width - X_ORIGIN * 2;
+ CHECK_VIEW_HEIGHT;
+ VLCMatrix *o_matrix = [[VLCMatrix alloc] initWithFrame: s_rc mode: NSHighlightModeMatrix cellClass: [NSButtonCell class] numberOfRows:2 numberOfColumns:2];
+ NSArray *o_cells = [o_matrix cells];
+ for( i=0; i < [o_cells count]; i++ )
+ {
+ NSButtonCell *o_current_cell = [o_cells objectAtIndex:i];
+ [o_current_cell setButtonType: NSSwitchButton];
+ [o_current_cell setControlSize: NSSmallControlSize];
+ if( psz_duptip != NULL )
+ {
+ [o_matrix setToolTip: [NSApp wrapString: [NSApp localizedString: psz_duptip] toWidth: PREFS_WRAP] forCell: o_current_cell];
+ }
+ switch( i )
+ {
+ case 0:
+ [o_current_cell setTitle:_NS("Command")];
+ [o_current_cell setState: p_item->i_value & KEY_MODIFIER_COMMAND];
+ break;
+ case 1:
+ [o_current_cell setTitle:_NS("Control")];
+ [o_current_cell setState: p_item->i_value & KEY_MODIFIER_CTRL];
+ break;
+ case 2:
+ [o_current_cell setTitle:_NS("Option/Alt")];
+ [o_current_cell setState: p_item->i_value & KEY_MODIFIER_ALT];
+ break;
+ case 3:
+ [o_current_cell setTitle:_NS("Shift")];
+ [o_current_cell setState: p_item->i_value & KEY_MODIFIER_SHIFT];
+ break;
+ }
+ [o_current_cell setTarget: self];
+ [o_current_cell setAction: @selector(configChanged:)];
+ [o_current_cell sendActionOn:NSLeftMouseUpMask];
+ }
+ CONTROL_CONFIG( o_matrix, o_module_name,
+ CONFIG_ITEM_KEY, p_item->psz_name );
+ [o_matrix sizeToCells];
+ [o_view addSubview: [o_matrix autorelease]];
+
+ s_rc.origin.x += [o_matrix frame].size.width + 20;
+ s_rc.size.height = 25;
+ s_rc.size.width = 100;
+
+ CHECK_VIEW_HEIGHT;
+
+ o_combo_box = [[VLCComboBox alloc] initWithFrame: s_rc];
+ CONTROL_CONFIG( o_combo_box, o_module_name,
+ CONFIG_ITEM_KEY, p_item->psz_name );
+ [o_combo_box setTarget: self];
+ [o_combo_box setAction: @selector(configChanged:)];
+ [o_combo_box sendActionOn:NSLeftMouseUpMask];
+ [[NSNotificationCenter defaultCenter] addObserver: self
+ selector: @selector(configChanged:)
+ name: NSControlTextDidChangeNotification
+ object: o_combo_box];
+
+ if ( psz_duptip != NULL )
+ {
+ [o_combo_box setToolTip: [NSApp wrapString: [NSApp localizedString: psz_duptip] toWidth: PREFS_WRAP]];
+ }
+ [o_view addSubview: [o_combo_box autorelease]];
+
+ for( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++ )
+ {
+
+ if( vlc_keys[i].psz_key_string && *vlc_keys[i].psz_key_string )
+ [o_combo_box addItemWithObjectValue: [NSApp localizedString:vlc_keys[i].psz_key_string]];
+ }
+
+ [o_combo_box setStringValue: [NSApp localizedString:KeyToString(( ((unsigned int)p_item->i_value) & ~KEY_MODIFIER ))]];
+
+ s_rc.origin.y += s_rc.size.height;
+ s_rc.origin.x = X_ORIGIN;
+ if( psz_duptip ) free( psz_duptip );
+ }
+ break;