jobisoft / quicktext

An extension for Thunderbird that lets you create templates that can be easily inserted into your own emails.
Mozilla Public License 2.0
184 stars 52 forks source link

Return and Enter are not the same #333

Closed coderfls closed 1 year ago

coderfls commented 1 year ago

Great tool! Thank you On issue: The key word is recognized if I enter Return but not if I press Enter. It will be fine if pressing Enter will work the same way

DE: Ein Schlüsselwort für eine Vorlage wird durch die Vorlage ersetzt, wenn man Return drückt, nicht aber bei Enter. Beides sollte IMHO gleich funktionieren

SamuelPlentz commented 1 year ago

I can confirm the Enter-key working while the NumpadEnter-key doesn't work.

Here is the List of keys definied:

https://github.com/jobisoft/quicktext/blob/29627538f6603675bd5cac3ca63b2ac1078a3ae9/chrome/content/settings.xhtml#L108-L124

Here it is used:

https://github.com/jobisoft/quicktext/blob/29627538f6603675bd5cac3ca63b2ac1078a3ae9/chrome/content/quicktext.js#L716-L721

To fix it this:

if (e.code == gQuicktext.keywordKey)

can be changed to this:

if (e.code == gQuicktext.keywordKey || (e.code == "NumpadEnter" && gQuicktext.keywordKey == "Enter"))
jobisoft commented 1 year ago

Thanks to everyone involved!