Skip to content

Make keyboard shortcuts configurable

Xfce offers various ways of customizing keyboard shortcuts. Unfortunately, for xfdesktop, unlike Thunar, shortcut keys are hard-coded. Therefore I would like to propose an a minor additional feature to have CTRL+BackSpace move the selected item(s) to the trash. It appears the shortcuts are provided in src/xfdesktop-file-icon-manager.c's xfdesktop_file_icon_manager_key_press(). From looking at the code, my impression is that all one would need to add is to insert right after the opeing switch(evt->keyval) line the following lines of code:

case GDK_KEY_BackSpace:

if(!(evt->state & GDK_CONTROL_MASK)

    || (evt->state & (GDK_SHIFT_MASK|GDK_MOD1_MASK|GDK_MOD4_MASK)))

    {

        return FALSE;

     }

    /* fall through */

In case one also wants to have CTRL+SHIFT+BackSpace directly delete the item(s) (I really don't have an opinion on that aspect) one needs to leave out GDK_SHIFT_MASK| above.

Edited by Georg Schwarz