extensions icon indicating copy to clipboard operation
extensions copied to clipboard

New extension: Wheel Scroll

Open DDen4ik-12 opened this issue 2 years ago • 13 comments
trafficstars

WheelScroll 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

whenScroll This event block runs scripts when the mouse wheel is scrolls in any direction.

When mouse wheel scrolls [SCROLL_TYPE] whenScrollDir

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

DDen4ik-12 avatar Nov 01 '23 08:11 DDen4ik-12

This could probably be put in Sensing+.

CST1229 avatar Nov 01 '23 09:11 CST1229

Is wheel intentionally mispelled everywhere?

CubesterYT avatar Nov 01 '23 15:11 CubesterYT

Is wheel intentionally mispelled everywhere?

In this word, I'm confusing the letter that needs to be written twice.

DDen4ik-12 avatar Nov 01 '23 16:11 DDen4ik-12

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: Событийные блоки

DDen4ik-12 avatar Jul 14 '24 11:07 DDen4ik-12

If you're done with your extension, later in the day, I will add translation functions and fix some things.

CubesterYT avatar Jul 14 '24 16:07 CubesterYT

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

DDen4ik-12 avatar Jul 14 '24 16:07 DDen4ik-12

Got it, I'll add it to my to do list

CubesterYT avatar Jul 14 '24 16:07 CubesterYT

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

GarboMuffin avatar Jul 26 '24 05:07 GarboMuffin

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

GarboMuffin avatar Jul 26 '24 06:07 GarboMuffin

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

DDen4ik-12 avatar Jul 26 '24 13:07 DDen4ik-12

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.

yuri-kiss avatar Dec 24 '24 21:12 yuri-kiss

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;

DNin01 avatar Jan 29 '25 00:01 DNin01