Nodedit-core icon indicating copy to clipboard operation
Nodedit-core copied to clipboard

pressing ctrl + shift saves the file.

Open pradeepmurugesan opened this issue 12 years ago • 5 comments

Its happening for me. Can you please let me know you guys to have the same issue ?

pradeepmurugesan avatar Jul 29 '13 08:07 pradeepmurugesan

Yes, this happends to me, too

newsocialifecom avatar Jul 29 '13 10:07 newsocialifecom

It's a problem with the keybind. It's checking for "ctrl s" and reads the first letter of "shift" in combination with the "ctrl" press as a match. I need to rework the specificity/checking on that.

ksafranski avatar Jul 29 '13 12:07 ksafranski

It's in the line 61:

if (this.cur_combo.indexOf(this.code)!== -1 && this.callback){

It should be

if (this.cur_combo == this.code && this.callback){

because it should check if it's EXACTLY that combination and not it the combination contains it.

newsocialifecom avatar Jul 29 '13 12:07 newsocialifecom

The problem is that the keybind work by contsantly building and clearing the list of keys pressed on the interval set by the handler. So if you press (for example) a b n 4 ctrl s within the 500ms (or whatever it's set to) you won't match for ctrl s if you do a straight comparison.

This may take some rethinking / reworking to get right.

ksafranski avatar Jul 29 '13 12:07 ksafranski

Oh, ok. Then why not use the builtin window.event.shiftKey and window.event.ctrlKey, so you can do it without saving all the pressed keys

newsocialifecom avatar Jul 29 '13 13:07 newsocialifecom