About Store Forum Documentation Contact
Donations:
169$/mo



Post Reply 
Mousewheel with Ms.exclusiveDisable()
Author Message
SatriAli Offline
Member

Post: #1
Mousewheel with Ms.exclusiveDisable()
Hi, I've been having a bit of an issue in my project.

I have a window with a 3D scene and a menu bar. I want the mouse to be visible, until the user holds a key, at which point the mouse goes into exclusive mode for camera control.
In both modes, mouse wheel is used for various tool functions (the project is a map editor).

So I set APP_MS_EXCLUSIVE in InitPre.
In update I check if the key is pressed, and call Ms.exclusiveEnable() or Ms.exclusiveDisable() accordingly.

This works perfectly for the cursor, and the mouse buttons it would appear.
But while exclusive mode is disabled, Ms.wheel() always returns 0...

I've tried the simplest test scenario by modifying the tutorial on input, and behaviour was the same: start in exclusive then disable, and the wheel doesn't work.
There's no issue in applications started without APP_MS_EXCLUSIVE.

Is this me doing something wrong, or a bug/limitation?
09-05-2010 03:52 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Mousewheel with Ms.exclusiveDisable()
it's a limitation

you can use Ms.hide/show and Ms.clip instead of exclusive
09-05-2010 07:03 PM
Find all posts by this user Quote this message in a reply
SatriAli Offline
Member

Post: #3
RE: Mousewheel with Ms.exclusiveDisable()
Right, thank you!

I had tried with Ms.freeze() but that actually locks the mouse position, I gather Ms.clip() always gives you a correct delta.

Impressed once more by the support you provide.
(This post was last modified: 09-06-2010 03:39 PM by SatriAli.)
09-06-2010 03:38 PM
Find all posts by this user Quote this message in a reply
SatriAli Offline
Member

Post: #4
RE: Mousewheel with Ms.exclusiveDisable()
After trying Ms.clip, it also appears to simply stop the mouse at the edge of the rectangle. So camera rotation range is limited by the size of the window, which is undesirable.

Did I do it wrong? I tried both clipping to a rectangle, and to the window.

I'm going to try setting the position manually each frame through a windows call after grabbing the delta, but I'm guessing that's going to mess things up...
09-06-2010 06:49 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: Mousewheel with Ms.exclusiveDisable()
You can use Ms.dir_d which is unaffected by mouse clipping
09-06-2010 08:00 PM
Find all posts by this user Quote this message in a reply
SatriAli Offline
Member

Post: #6
RE: Mousewheel with Ms.exclusiveDisable()
Excellent, thank you.
09-07-2010 06:48 PM
Find all posts by this user Quote this message in a reply
Post Reply