Opened 10 years ago
Closed 9 years ago
#401 closed enhancement (fixed)
Add keyboard shortcuts
| Reported by: | dstillman | Owned by: | dstillman |
|---|---|---|---|
| Priority: | major | Milestone: | 1.0 RC 1 |
| Component: | interface | Version: | 1.0 |
| Keywords: | Cc: |
Description
Probably best to have these customizable via about:config, as Web Developer extension does
Change History (8)
comment:1 Changed 10 years ago by dstillman
comment:2 Changed 10 years ago by dstillman
(In [986]) Addresses #401, Add keyboard shortcuts
Closes #371, OCLC OpenURL resolver lookup should be a manual operation
Closes #341, Switch preferences to use prefwindow with multiple prefpanes
- Keyboard shortcuts for various actions and interface elements while Zotero pane is open, editable via new preference pane (which needs a better icon) -- more coming
- Switched keyboard shortcuts on Mac (including Zotero pane shortcut) back to Command-Shift, since apparently Command-Option-everything is more or less totally broken on OS X -- this does conflict with Redo on OS X, but people can change one of the two if they care.
- Option (on by default) to try to override existing shortcuts, which should help with some conflicts (e.g. Web Developer extension has a lot)
- Preferences now use prefwindow, which is totally buggy but when it works makes for a nicer and more platform-specific UI (e.g. preferences take effect immediately on OS X with no OK button)
- "Search for Resolvers" button instead of automatic request
- Zotero.Prefs.get() now takes a second 'global' param to easily get non-Zotero prefs
- Focus tag selector on display
comment:3 Changed 10 years ago by dstillman
- Milestone changed from 1.0 Beta 3 to 1.0 Beta 4
Still needed:
- Control-tab to cycle through metadata pane tabs
- Add new creators via keyboard
- Keyboard support for some of the other metadata panes?
comment:4 Changed 10 years ago by alberto
Ah, so this is why the shortcut for my own extension disappeared from the Tools menu!
I've been using Zotero since Firefox 2 was in Beta, and I must say that I love it. I have recommended it to other people, and added the COiNS metadata to my publications page so that they get picked up by Zotero.
Now, I'm also an extension developer myself.
Since a few weeks ago, I noticed that the shortcut for starting one of my extensions didn't appear any more in the menu. I assumed that it was some mistake in my in-development code, so I didn't pay much attention to it (I use SeaMonkey for development so that it doesn't interfere with browsing) until yesterday, when I spent a considerable amount of time checking my code, modifying it in several ways, testing again and again, and coming out empty-handed. I did tidy it up in the process, so it wasn't a complete waste of time.
I had thought that there could be a conflict with another extension, so I looked at all the entries in the Tools menu, but no other extension appeared to be using the same shortcut.
Then I started removing extensions, until the shortcut came back. I was rather surprised to find that it had something to do with Zotero.
Since the shortcut was not in the Tools menu, I thought that there was some bug in Zotero's overlay, so I unpacked it and found that there were other shortcuts defined that were not displayed in the menu, and as a comment in the code indicated, were configurable in the preferences. So I opened Zotero's preferences and, sure enough, there was the shortcut, together with an ominous-sounding checkbox labeled "Try to override conflicting shortcuts". That's why my shortcut disappeared after the last Zotero update!
Now I see that Zotero grabs no less than seven global shortcut keys, only one of which is visible in the Tools menu, and that it silently overrides any other extensions. My extension takes up only one, to start it, and then any shortcuts are local to the application window.
I understand why you did this, but the question is, what should I do now?
Should I make my applications override any others silently?
What if my applications and Zotero engage in a silent fight over the global shortcuts? Who shall prevail? :)
I would suggest that, if some action is important enough to warrant a global shortcut, it should also appear in the menu. This way we could notice conflicts more easily, and discover the shortcuts without having to read any manual or whatever.
Additionally, I would consider it fairer if the option for overriding other extension's shortcuts was disabled by default. You can have an entry in your troubleshooting documentation for "I hit Zotero's xyz shortcut, and it doesn't work/another application comes up", directing the user to the preferences panel where he can either redefine Zotero's keys or override the other application. Then I would have a corresponding entry in my documentation for the reverse case.
comment:5 Changed 10 years ago by dstillman
Sorry for the hassle--you're right that Zotero isn't really being the best neighbor here in some ways (though we're trying to in other ways--more on that below).
Some notes:
- To start, I'll change the override pref to default to off. It was really the Redo shortcut on OS X that we were concerned about, but you're right that overriding 7+ global shortcuts isn't particularly reasonable, and we can just mention this in the documentation.
- Zotero actually does give debug output when it overrides keys, but you'd need to have its debug logging enabled via about:config (extensions.zotero.debug.log) and comb through the output, which admittedly isn't all that reasonable an expectation.
- The fact that Zotero doesn't put most of its commands in the menu is actually an attempt to co-exist better with other extensions--we don't actually want them to be global shortcuts. With the exception of the main Z-pane shortcut, the current ones only have an effect when the Zotero pane is open, and otherwise other extensions that used onkeydown instead of a <key> would be able to use the shortcut (at least, I think--I haven't actually tested this). I known this is non-standard, and I wish there were a better mechanism, but if other extensions that don't need full-time shortcuts keys were to do this, there'd be fewer conflicts... As more and more extensions
comment:6 Changed 10 years ago by dstillman
comment:7 Changed 9 years ago by dstillman
comment:8 Changed 9 years ago by dstillman
- Resolution set to fixed
- Status changed from new to closed
Closing. New ticket, #711, for additional improvements.
(In [931]) Addresses #401, Add keyboard shortcuts
Improves tabbing between UI panes, including into metadata fields
Still some quirks and things that don't work but should (e.g. ctrl-tab to cycle through tabs in metadata pane and ability to add new creators via the keyboard), but better