extensions
extensions copied to clipboard
New extension: Wheel Scroll
I created the "Wheel Scroll" extension. It has two event blocks that are runs scripts when the mouse wheel is scrolled.
Blocks
When mouse wheel scrolls whenScroll
This event block runs scripts when the mouse wheel is scrolls in any direction.
When mouse wheel scrolls [SCROLL_TYPE] whenScrollDir
This event block runs scripts when the mouse wheel scrolls in the specified direction.
This block has a
SCROLL_TYPE list with direction types:
- up
- down
- to the left
- to the right
- out
- in
- along the x-axis
- along the y-axis
- along the z-axis
This could probably be put in Sensing+.
Is wheel intentionally mispelled everywhere?
Is wheel intentionally mispelled everywhere?
In this word, I'm confusing the letter that needs to be written twice.
Update 1.1 + Small update
New blocks
delta [DELTA_TYPE] getDelta
This reporter gets scrolling delta in the specified axis, or gets delta mode.
Use this block in scripts starting with one of these event blocks:
If you're done with your extension, later in the day, I will add translation functions and fix some things.
If you're done with your extension, later in the day, I will add translation functions and fix some things.
I have finished making the extension
Got it, I'll add it to my to do list
okay, i like the icon, i like the event block, but the block to get how much you scrolled by only working inside of the event block feels wrong, it doesn't match how the existing mouse x/y works
there was another pull request that made them work outside of the event block by just summing up delta x/y/z, but that feels wrong because these are not absolute positions but just relative values, and also incompatible with exposing deltaMode
the precedent from pointerlock -- good or bad -- is for the blocks to return the delta from the previous frame
which has some interesting questions, like what happens if someone scrolls both up and down in the time between two frames
okay, i like the icon, i like the event block, but the block to get how much you scrolled by only working inside of the event block feels wrong, it doesn't match how the existing mouse x/y works
I've made this block work outside of event blocks
Similar PR: #638
This could probably be merged into cursor. As well as this could merge with lily's changes or one of the 2 can supersede some parts or the whole of the other PR.
Delta values should probably be accumulated so that if the user scrolls quickly, no data is lost.
In other words, add up the delta values from all the scroll events since the past frame. That way, if the user scrolls down 90 times per second, that is properly recognized by the project as 3 scrolls per frame (at 30 FPS). The buffer can be reset between each frame.
- deltaX = e.deltaX;
- deltaY = e.deltaY;
- deltaZ = e.deltaZ;
+ deltaX += e.deltaX;
+ deltaY += e.deltaY;
+ deltaZ += e.deltaZ;