Closed zakius closed 4 years ago
Hi,
Maybe you're using an outdated code? Mouse Gestures uses cmd_moveBottom and cmd_moveTop.
Do you have any reference how to find these codes?
https://searchfox.org/mozilla-central/source/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js
Thanks for the quick reply
These commands don't work for me for some reason, maybe there's some version mismatch or other issue, I'll look into it one more time. And thank you for that list
I use a different script that calls one of these function: https://developer.mozilla.org/en-US/docs/Archive/Mozilla/XUL/List_of_commands
Specifically cmd_scrollTop
. Don't know if this is possible here.
Just letting you know I figured it out
first of all this command works but has to be called in the right context, directly in the mousedown handler
secondly I had some issues with making rocker left work properly which may have caused false negatives, in particular deselect command was messing with it, for my usecase it doesn't really matter so I just commented it out and now it does what I expect
thanks again
first of all this command works but has to be called in the right context, directly in the mousedown handler
Which command? I use cmd_moveBottom
and cmd_moveTop
in mouseup handler, like all mouse gestures. Rocker gestures are handled by mousedown and scroll gestures by wheel.
I use a different script that calls one of these function (...) Specifically
cmd_scrollTop
Do you have an example where scrollTop/scrollBottom work and moveBottom/moveTop don't? I think they and cmd_[begin|end]Line are essentially the same.
Windows and Linux uses cmd_[begin|end]Line for Home/End keys in browser context, while Mac uses cmd_scroll[Top|Bottom].
I'm not sure if I use move
or scroll
, will check tomorrow, but what I meant it doesn't work in chromeListener
at all, so I gave up on sending message from mousedown handler and executed these commands directly there
So I got two examples where gesture to scrollup/down doesn't work:
Searchfox, at least before you leftclick the scrollabe element to give it focus: https://searchfox.org/
CodeMirror (inside the text editor): https://codemirror.net/demo/simplemode.html (example of site using CodeMirror: codepen.io)
I already fixed that and will push the update soon.
Do you mind if I submit PR with improved configurability? I'd build array of available actions and map gestures to them somewhere at the top of the script to make it clearer and easier to update for people who customized their bindings
EDIT: as I'm digging deeper into it it seems it may be quite challenging to do it properly due to some gestures requiring context and some performing different tasks depending on context, I'll play around a bit more but may give up on that
EDIT 2: okay, I'm giving up on this, I only end up breaking stuff all the time
Go ahead! But yes, I think it's not so easy at it may seen. I didn't actually write the script to make it easily configurable.
Closing this one because it's working for me, I can't reproduce any issue.
Hello, first of all I'd like to thank you for sharing your work. As I can see you have scroll to top action bound in gestures script but I can't get it to work any way, most likely it should replicate scroll to bottom (sending keystroke), but I can't figure out what would be the code for
Home
button (obviously changing23
to24
in that number doesn't work). Do you have any reference how to find these codes?