WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Is it possible to detect mouse-wheel turn in a native/console application?  (Read 1880 times)

Offline trithilon

  • Newbie
  • *
  • Posts: 11
I am making games using raylib on piCore. They work fine - I am able to detect right, left and center mouse buttons along with movement. But wheel turns don't register. Is it impossible? Or is it a problem with raylib and I should take it up with them?

Cheers :)

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11637

Offline trithilon

  • Newbie
  • *
  • Posts: 11
No it doesn't. Hence this thread. None of the examples with mousewheel seem to work.
I've filed and issue with raylib as well... but they creator isn't sure if there is a driver or something which can listen to that input.
https://github.com/raysan5/raylib/issues/2660
I am wondering how is it possible the X can listen to scroll but console cannot.

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 714
Maybe you can use xinput program to test/debug the wheel functionality ?

Code: (bash) [Select]
xinput list --long
« Last Edit: August 23, 2022, 12:56:02 AM by patrikg »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Commented on that github issue, but yeah, it's all raylib. /dev/mouse supports wheels if the app requests it, and X is not needed to use evdev nodes, which support as many buttons as mice can possibly have.
The only barriers that can stop you are the ones you create yourself.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11637

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11637
Hi trithilon
I noticed the example I linked to in reply #1 returns an int, but according to this:
https://www.raylib.com/cheatsheet/cheatsheet.html
later versions (4.2) return a float or struct Vector2 (2 floats).

Offline trithilon

  • Newbie
  • *
  • Posts: 11
Hi trithilon
Does this help:
https://forums.raspberrypi.com/viewtopic.php?t=30762#p267522
It seems like using the PS2 Intellimouse protocol is the way.
Hope they add support soon: https://github.com/raysan5/raylib/issues/2660

Thanks and sorry for missing your reply.