Skip to content
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

Horizontal scroll event #569

Open
viluon opened this issue Aug 19, 2018 · 11 comments
Open

Horizontal scroll event #569

viluon opened this issue Aug 19, 2018 · 11 comments

Comments

@viluon
Copy link

viluon commented Aug 19, 2018

It'd be nice if there were a mouse_horizontal_scroll (/mouse_horiz_scroll/mouse_hor_scroll, or maybe mouse_scroll_horizontal/...) event, or an extra parameter to the existing mouse_scroll event, either a boolean indicating the scroll axis, or another number equal to the amount of horizontal scrolling performed.

This would enable programs to react on full 2D scrolling on notebook touchpads, for example.

@nothjarnan
Copy link

nothjarnan commented Aug 20, 2018

If you're talking about mouse_scroll, it could probably be as simple as to have os.pullEvent("mouse_scroll")
return another parameter for horizontal scroll direction, like it does with vertical.
so the output would be event, verticalDirection, horizontalDirection, x,y.
Though, I'm no expert and there's most likely a better way to do this.

@SquidDev
Copy link
Contributor

I feel it'd be better to do this as a separate event. There's probably a fair few programs that will not cope with the scroll delta being zero (doing if delta > 0 then else and what not).

@nothjarnan
Copy link

fair point. so a mouse_scroll_horizontal event would be doable?

@viluon
Copy link
Author

viluon commented Aug 20, 2018

Oh right, thanks @nothjarnan, I forgot about the mouse_ prefix. Updated the issue.

@SquidDev
Copy link
Contributor

I believe glfw reports both x and y scroll deltas, so should definitely be possible for 1.13. I suspect 1.12 is feasible, just haven't looked into it.

@hugeblank
Copy link

Not to mention that this would enable much higher end mice with horizontal scrolling to be of use like this fabulous one that I personally own and think everyone should have because why wouldn't you.

On a side note, the mouse does have four (maybe six, idk if the DPI shift buttons count) additional buttons. Maybe it's a good call to have a mouse event overhaul in general?

@nothjarnan
Copy link

@hugeblank Allow for more mouse buttons? The one issue I could see with that is that programs are made that only work with certain mice, or a mouse that has x amount of buttons. But then it'd just be as easy as asking the author to make the buttons re-bindable, to be fair.

@viluon
Copy link
Author

viluon commented Sep 26, 2018

@nothjarnan @hugeblank while this isn't a conversation well suited for this issue, strictly speaking, I believe ComputerCraft already supports more buttons — any extra buttons are simply assigned higher numbers (for example, my back button triggers an event, and is listed as button 5). This may be a perk of CCEmuX, however.

@hugeblank
Copy link

I think so. I have tried to use buttons in game and iirc this doesn't work. May have been a CC:T thing too.

@SquidDev
Copy link
Contributor

SquidDev commented Sep 26, 2018

Yeah, CC explicitly guards against that. CCEmuX really should too:

if( !m_locked && computer != null && computer.isColour() && button >= 0 && button <= 2 )

Edit: And it does! Yes, I'm evil.

@AnCarsenat
Copy link

horizontal mouse scroll doesnt exist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants