Custom keyboard shortcuts

Hello everyone!

I just wanted to ask if there is any way how to define my own keyboard shortcuts in frappe?

Thanks!

6 Likes

Thanks! Thats exactly what I need! :slight_smile:

@TurkerTunali

i did exactly like the video but the shortcut did not show up .

custom script involves this code :

frappe.ui.keys.add_shortcut({
    shortcut: "alt+ctrl+n",
    description: __("Open New issue"),
    action: () => {
            frappe.new_doc("Issue");
        }
});

hooks.py involves this :

# Includes in <head>

# ------------------

# include js, css files in header of desk.html

# app_include_css = "/assets/diamondpharma/css/diamondpharma.css"

app_include_js = "/assets/diamondpharma/public/js/custom_test.js"

shortcut

it needed :

bench clear-cache
bench build
bench restart

it worked just fine

2 Likes