Try ERPNext Buy Support Partners Foundation

How to add Short keys?


I want to introduce more short keys like Ctrl+S to save and Ctrl+B to New Form.

1 Like

@shahid, take a look there

1 Like

Thank you @max_morais_dmm,
I want to add some shortkeys like
Ctrl+shift+d to open doctype of the form,
Ctrl+shift+s to open custom script of the form.
Ctrl +d to duplicate the form etc.

How do i achieve that?

@shahid here you will find almost all functions references, you want to create each bindind

1 Like

@max_morais_dmm thanks let me check this.

I’ve tried this piece of code for Ctrl+i for duplicate but not working.

frappe.ui.keys.on('ctrl+i', function(e) {
		if(in_list(frappe.boot.user.can_create, me.frm.doctype) && !me.frm.meta.allow_copy) {

@shahid, frappe have already builting functions for permissions:

Also, probably your code is not working, due some unaccessible namespace or variable, like me and me.frm


This is also not working.

frappe.ui.keys.on('ctrl+i', function(e) {

But working when i am calling it via custom script in form.
not working globally.

You need to make sure that you are also disabling the browser default key combination with this:

So try this for duplicating and let me know:

frappe.ui.keys.on('ctrl+d', function(e) {
    var route = frappe.get_route();
    console.log("CTRL+D was pressed");
    if(route[0]==='Form' || route[0]==='List') {
    	return false;


I need to do same thing (but another shortcut key) but to work on the child table, so if I am standing on row#3 at item_code field and I pressed F1 or F2 or Shift+i, then I need to know which row of the child table that I am standing at it when I pressed this shortcut key and then I need to run script. How I can do this?