-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent thread expansion with j/k navigation keys #126
Comments
Use the unset binding to unbind built-in key bindings. Command syntax Do you want the command for the "Ignore Thread" menu item? i.e. Menu Bar > Message > Ignore Thread Toggle "Ignore Thread" menu item:
Check "Ignore Thread" menu item:
Uncheck "Ignore Thread" menu item:
|
@morat523035 thanks for you response. I'd like to be able to continue suing J and K to navigate up and down the message list but when I come to a thread (thats collapsed) I dont want the thread to expand as I go up/down the list. I would like to use the keys H and L to expand or collapse the thread when needed. If that makes sense. Kind of how the arrow keys currently function. I literally would like to bind J and K to the up/down arrow keys and H and L to the left/right arrow keys. Is that possible? |
You want to synthesize a keypress event on the active window. The nsIDOMWindowUtils.sendKeyEvent method doesn't work anymore. Try the nsIDOMWindowUtils.sendNativeKeyEvent method.
Reference Another example |
Thanks a ton for this helpful comment. Here is the full set of hjkl mappings in case anyone else needs to do this:
|
Thanks for the ideas above. I use Arch Linux and couldn't find any Linux constants in https://searchfox.org/mozilla-esr102/rev/2ac4b481997e2bcf569c91d8bb7ab1e5a0b7b1b0/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js. Looking at the Thunderbird source, I used a more JavaScript approach to send keybinds. This should work on all platforms. I also included the Neovim keys {
"h": "(() => { let e = window.gTabmail.currentAbout3Pane.document.activeElement; while (e) { if (e.id === 'folderTree' || e.id === 'threadTree') { e.handleEvent(new window.KeyboardEvent('keydown', { key: 'ArrowLeft' })); break } e = e.parentElement } })()",
"j": "(() => { let e = window.gTabmail.currentAbout3Pane.document.activeElement; while (e) { if (e.id === 'folderTree' || e.id === 'threadTree') { e.handleEvent(new window.KeyboardEvent('keydown', { key: 'ArrowDown' })); break } e = e.parentElement } })()",
"k": "(() => { let e = window.gTabmail.currentAbout3Pane.document.activeElement; while (e) { if (e.id === 'folderTree' || e.id === 'threadTree') { e.handleEvent(new window.KeyboardEvent('keydown', { key: 'ArrowUp' })); break } e = e.parentElement } })()",
"l": "(() => { let e = window.gTabmail.currentAbout3Pane.document.activeElement; while (e) { if (e.id === 'folderTree' || e.id === 'threadTree') { e.handleEvent(new window.KeyboardEvent('keydown', { key: 'ArrowRight' })); break } e = e.parentElement } })()",
"u": "(() => { let e = window.gTabmail.currentAbout3Pane.document.activeElement; while (e) { if (e.id === 'folderTree' || e.id === 'threadTree') { e.handleEvent(new window.KeyboardEvent('keydown', { key: 'PageUp' })); break } e = e.parentElement } })()",
"d": "(() => { let e = window.gTabmail.currentAbout3Pane.document.activeElement; while (e) { if (e.id === 'folderTree' || e.id === 'threadTree') { e.handleEvent(new window.KeyboardEvent('keydown', { key: 'PageDown' })); break } e = e.parentElement } })()",
"g g": "(() => { let e = window.gTabmail.currentAbout3Pane.document.activeElement; while (e) { if (e.id === 'folderTree' || e.id === 'threadTree') { e.handleEvent(new window.KeyboardEvent('keydown', { key: 'Home' })); break } e = e.parentElement } })()",
"G": "(() => { let e = window.gTabmail.currentAbout3Pane.document.activeElement; while (e) { if (e.id === 'folderTree' || e.id === 'threadTree') { e.handleEvent(new window.KeyboardEvent('keydown', { key: 'End' })); break } e = e.parentElement } })()",
// ...
} |
Thanks a lot for that, this is exactly what I need! Sadly, it doesn't work on my setup (Ubuntu 24.04), any reason in your opinion? |
I have no idea as you gave too little info, not even what keys worked and what didn't. The best and probably only way is to debug the code yourself in |
Good morning,
I'm wondering if there is a way to prevent email threads from expanding when using j/k navigation keys. I'd like to be able to map h/l keys to expand and collapse threads like (like using Vim). With that said I'm very grateful for this add-on.
Cheers,
-Chris
The text was updated successfully, but these errors were encountered: