mlazdans / qnote

QNote add-on for Thunderbird email application
13 stars 4 forks source link

Keypresses are getting stolen by another add-on #16

Closed SergeLalonde closed 2 years ago

SergeLalonde commented 2 years ago

After upgrading to TB 91.2, I noticed that when I start typing into a new QNote, certain keys were getting stolen by another add-on called Nostalgy++ (https://addons.thunderbird.net/en-US/thunderbird/addon/nostalgy_ng/?src=userprofile) because they're used as shortcuts. Ex: s for Save email to folder. I never noticed this happening before, but it's possible that it was happening previously as I often just paste the information I want in the QNote. Interestingly, the author of Nostalgy++ makes an add-on similar to QNote called XNote++. I have no idea if the two are compatible. I don't know if there's anything that you can do to prevent having the keys stolen when the QNote window has focus, but I thought that I would report this to you in case you were able to fix it. Of course, I will report this to the author of Nostalgy++ as well. Thank you for a great add-on!

mlazdans commented 2 years ago

There's really nothing I can do. This add-on stops event propagation calling NostalgyStopEvent() function after "a", "b", "c" (and some others) effectively stealing these keystrokes from others :( It really should be fixed by opto.

function NostalgyStopEvent(ev) {
  ev.preventDefault();
  //ev.stopPropagation();
  ev.stopImmediatePropagation();
}
ThomasHeinrichSchmidt commented 2 years ago

I think "stealing these keystrokes" is not the real problem. Keystrokes are not only "stolen" while typing in QNote, but the relevant functions associated with those keys are actually performed by Nostalgy++. This is not only anoying but leads to unwanted and unforeseen Nostalgy++ operations while typing in QNote. This all did not happen in TB78 using the same plugin versions (I think). So I think QNote would need to exclusively register the keyboard as soon as the user opens a note. All other add-ons should ignore what's typed.

mlazdans commented 2 years ago

I do not see way how to "exclusively register the keyboard", because once Nostagly gets its keyboard event it stops propagation. Shame.

ThomasHeinrichSchmidt commented 2 years ago

Yes, but even if it would propagate the event Nostalgy++ would still take the unwanted and unforeseen Nostalgy++ actions. And - why did it work in TB78?

mlazdans commented 2 years ago

Yes, it would indeed most likely. Probably TB78 was different layout and QNote was out of main window. Just guessing.