pjeby / pane-relief

Obsidian plugin for per-pane history, pane movement/navigation hotkeys, and more
223 stars 6 forks source link

Navigation with forward and back mouse buttons not working #8

Closed jsmorabito closed 3 years ago

jsmorabito commented 3 years ago

Not sure if I'm misunderstanding the behavior outlined here:

"In addition, Pane Relief captures the fourth and fifth mouse buttons ("back" and "forward") and applies the navigation to the pane (if any) where the mouse was pointing when those buttons were clicked."

I'm pressing the forward and back buttons on my mouse and expecting the active pane to respond. The second part of that quote makes it seem like I need to have the cursor in a particular location for this to work?

Let me know if you need more details!

pjeby commented 3 years ago

What version of obsidian are you using? Do the buttons in the titlebar work? How about the keyboard commands for forward and back? Is there any history in the current pane? (i.e. do the titlebar nav buttons have numbers next to them?)

jsmorabito commented 3 years ago

Obsidian 0.12.16

Could it have to do with the mouse I'm using? Forward and back buttons don't actually work with pane relief off

pjeby commented 3 years ago

Yeah, it's the mouse then, or the driver, or perhaps the button configuration if your driver offers that. Do they work in other programs, especially Chrome? Obsidian is an Electron app, which is basically Chrome under the hood. Also, what OS do you have?

Finally, if you click in an inactive Obsidian pane with the forward or back buttons, does the pane become active?

jsmorabito commented 3 years ago

Yes, it's working in other programs including chrome. I'm using and MX Master 3 on Mac.

"Finally, if you click in an inactive Obsidian pane with the forward or back buttons, does the pane become active?" Yes to this as well.

I'm seeing that there is a Mac specific version of the mouse that I have...I wonder if that's my problem, that I'm using the multi-os version... very strange :/

If it seems like this is not a bug on your end then we can close this issue

pjeby commented 3 years ago

Hm... have you seen this: https://stackoverflow.com/a/68274361 ? It seems to describe an issue with the MX Master not having those buttons mapped as buttons 4 and 5 on Mac without software configuration.

It's possible the issue could be addressed in pane-relief by checking for other button numbers, but I don't know what button numbers they are registering as currently. The default button numbers are 3 and 4 in the event code -- i.e., pane-relief looks for a mouseup of button 3 or 4 to control history.

Hm. Try this. In the inspector window of Obsidian, type:

window.addEventListener("mouseup", console.log)

and hit enter. Then try using the forward and back buttons in an Obsidian pane. You should see "MouseEvent" items occurring in the inspector log. Click on the triangle-arrow next to them to expand them, and look to see what button number occurs for each item. When done, turn it back off using:

window.removeEventListener("mouseup", console.log)

If MouseEvent objects don't show up when you use the forward/back buttons, the issue is likely that the event is being trapped by some other plugin. If they do show up, the button numbers will tell us how the buttons on your mouse are mapped and I can add them to pane-relief.

If the events don't show up, try clicking in the panes with other buttons, to confirm that clicks are being tracked at all. Alternately, add a mousedown listener and see if the forward/back show up then. If forward and back show up as mousedown but not mouseup, it's a plugin conflict. If they don't show up as either, it's likely a software issue, such that the buttons aren't triggering standard mouse events.

jsmorabito commented 3 years ago

So forward and back buttons on the mouse are working when I turn pane relief off (contrary to my earlier statement). Clicks are logged with the event listener, but none for forward and back button on the mx master mouse. I'm also seeing some strange behavior where I can go forward and back between two pages and the number of "go back" pages goes up, and I'm only able to go forward and back between those two pages, like the forward back behavior is stuck there. If I navigate through other pages forward and back doesn't work... I tried both of the applications linked in that thread without success. I might try again one more time to double check that I did everything right before thinking about maybe getting the Mac version of this mouse lol. Thanks for the continued help! Dying to be able to use the plugin fully

https://user-images.githubusercontent.com/46250921/133931960-b73c5360-6dfc-4522-9cc4-dadf4d098ac0.mov

jsmorabito commented 3 years ago

I think I may have found my solution! Downloaded the mx mouse application and set forward and back to the keybindings in obsidian....I think I'm good now then? It's working as I expect haha😅

image

pjeby commented 3 years ago

Okay. So I take it there wasn't an option to set them to "button 4" and "button 5"? Also, what was the default for those buttons before you set it?

jsmorabito commented 3 years ago

The options menu is extensive but I didn't see anything specifically called button 4 or button 5 to map them to. The first image shows the default setting for those buttons "forward" and "back"

image

some of the settings: image

pjeby commented 3 years ago

Ok, I give up then. It must be issuing non-click events for Forward and Back (or at least not mouseup), so there's no way I can capture them. I'll go ahead and close this.

jsmorabito commented 3 years ago

thanks again for the help. happy that I can use your plugin in the end :)