wshanks / Zutilo

Zotero plugin providing some additional editing features
Other
1.52k stars 71 forks source link

Keyboard shortcuts not matching characters #136

Open small-fork opened 4 years ago

small-fork commented 4 years ago

Hello,

Thank you for yoru work on Zutilo. It's a huge time-saver! I've had this issue since first using Zutilo, and have worked around it. However, I'm running out of shortcuts that don't run into this issue (and are thus not usable).

Certain characters and letters are not recorded properly. I can't seem to determine a pattern or reason. I haven't kept full track by any means, but here are some examples showing what was populated in the Zutilo preferences vs. what I pressed on my keyboard (in red):

image

To be clear, the shortcuts assigned do not work when this odd character behavior occurs. I have tried using the shortcuts I actual put in, but it doesn't work unless it's one that displayed properly as entered.

I did try disabling and re-enabling Zutilo. This has also predated the current version. Please let me know what additional information I can provide—if any. And thank you so much for your time and work on this extension!

wshanks commented 4 years ago

I think what you are seeing is similar to what was described in https://github.com/willsALMANJ/Zutilo/issues/76#issuecomment-429166322. What is happening there is that you are using the alt/option key in your shortcuts but macOS handles that key differently than Windows and Linux. The default behavior for that key in macOS is to modify the character code that is produced when you type other keys. So you get the odd characters that you see appearing rather than a meta key modifier to an ANSI keycode.

From searching around, it seems like the behavior of option is usually configured on a per-app basis in macOS. Perhaps it can be configured in Zotero. It seems like option modifies the key code when typing in a text box but perhaps like the meta key otherwise. This might be confusing Zutilo since it captures the keycode in a text box. It might be possible to enter the key combination as JSON directly into the about:config entry for that shortcut. Type "zutilo.shortcut" in the search box in about:config ("config editor" from the Advanced pane of Zotero's preferences) and enter "alt" for the modifiers and "D" for the "key" for example.