Permalink
Browse files

Open context menu with shift+f10

  • Loading branch information...
1 parent 90b8fe9 commit 1e6cc7b69b9f5b4ee4b85dc4d927660171536566 @geekless committed Mar 24, 2012
Showing with 19 additions and 10 deletions.
  1. +19 −10 src/main-win.c
View
@@ -212,6 +212,19 @@ static void on_folder_view_sort_changed(FmFolderView* fv, FmMainWin* win)
update_sort_menu(win);
}
+static void open_context_menu(FmFolderView* fv, FmMainWin* win)
+{
+ FmFileInfoList *files = fm_folder_view_get_selected_files(fv);
+ FmFileInfo *info;
+ if(files && !fm_list_is_empty(files))
+ info = fm_list_peek_head(files);
+ else
+ info = NULL;
+ on_folder_view_clicked(fv, FM_FV_CONTEXT_MENU, info, win);
+ if(files)
+ fm_list_unref(files);
+}
+
static gboolean on_view_key_press_event(FmFolderView* fv, GdkEventKey* evt, FmMainWin* win)
{
int modifier = ( evt->state & ( GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK ) );
@@ -237,18 +250,14 @@ static gboolean on_view_key_press_event(FmFolderView* fv, GdkEventKey* evt, FmMa
}
break;
case GDK_Menu:
+ open_context_menu(fv, win);
+ break;
+ case GDK_F10:
+ if(modifier & GDK_SHIFT_MASK)
{
- FmFileInfoList *files = fm_folder_view_get_selected_files(fv);
- FmFileInfo *info;
- if(files && !fm_list_is_empty(files))
- info = fm_list_peek_head(files);
- else
- info = NULL;
- on_folder_view_clicked(fv, FM_FV_CONTEXT_MENU, info, win);
- if(files)
- fm_list_unref(files);
- break;
+ open_context_menu(fv, win);
}
+ break;
}
return FALSE;
}

0 comments on commit 1e6cc7b

Please sign in to comment.