Using the mouse scroll wheel

Discussions related to mouse, keyboard and Graphical User Interface
Post Reply
Patrick M
Posts: 39
Joined: Mon 02 Apr 2018, 21:51

Using the mouse scroll wheel

Post by Patrick M » Tue 12 Jun 2018, 11:20

Hello,

I've been wondering, how do you check if the user has rolled the scroll wheel? I know it's possible since SDLIDE allows you to scroll by turning the wheel, but I had a look through the SDLIDE code and couldn't immediately recognise anything that looked like it was checking the wheel.

I also looked at the BB4W manual, but the information I could find about the mouse didn't seem to mention the wheel.

Does anyone know?

Thanks.
PM

DDRM
Administrator
Posts: 22
Joined: Mon 02 Apr 2018, 18:04

Re: Using the mouse scroll wheel

Post by DDRM » Tue 12 Jun 2018, 11:44

Hi Patrick,

You can read the mouse scroll wheel with GET or INKEY: wheel up returns 140, and wheel down returns 141.

Best wishes,

D

Patrick M
Posts: 39
Joined: Mon 02 Apr 2018, 21:51

Re: Using the mouse scroll wheel

Post by Patrick M » Tue 12 Jun 2018, 12:39

Hi DDRM,

Thanks for the information. This reminds me of another question I had on mind recently. Once you've read a key from the keyboard buffer with GET, is it possible to re-insert that key value back into the keyboard buffer?

It's probably not good programming/design practice, but I have two different routines for handling mouse input and keyboard input. I'd like my mouse routine to check for mouse wheel events in the keyboard buffer, take only those events, and then put back into the keyboard buffer everything else that was in there that wasn't a mouse wheel event, so that my keyboard routine can work on those separately.

Patrick

Post Reply