Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Hollister Man on Wed 16/06/2004 02:38:08

Title: Is it possible to 'lock' the mouse in window mode?
Post by: Hollister Man on Wed 16/06/2004 02:38:08
I have been playing with DOSBox lately and wondered how hard it would be to 'lock' the cursor to the AGS game window when playing in window mode?  I have a heck of a time when clicking near the edges of the screen, making sure the cursor lands inside.

I hate to be a part of the glut of suggestions lately, but this is a constantly annoying little tiddlywink.  If its a pain, ignore me. :)
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Gregjazz on Wed 16/06/2004 03:09:24
That little SetMouseBounds thing or whatever won't work, correct? Because you're trying to use it in the windowed mode rather than fullscreen.

I do not know of any other program that is in a window that locks your cursor like that.
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Gilbert on Wed 16/06/2004 03:16:19
That's not possible at the moment I think, and if someone played a game under window mode they usually had a reason to, like for example wanted to execute some other programmes alongside the AGS game, so I don't think locking the cursor to one window is a very good idea.

However I know how frustrating that in many AGS games, sometimes you need to click really close to screen edges, which was quite hard in gereral if you play them under window mode. So I think it's the responsibility for those who are making the games to make sure that you won't need to click really close to edges, actually they should have tried it when testing their game.
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Hollister Man on Wed 16/06/2004 03:42:10
Actually in DOSBox, it takes an alt-tab to get out, I think that's it.  I run in a window because my monitor throws the screen way off to the side in 640 mode. :)
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Gilbert on Wed 16/06/2004 03:52:24
Quote from: Hollister Man on Wed 16/06/2004 03:42:10
I run in a window because my monitor throws the screen way off to the side in 640 mode. :)
Could you just adjust your monitor's setting for it?
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: TerranRich on Wed 16/06/2004 04:23:00
Someone could make a program in VB or some such language that restricted the mouse coordinates and would stay running in the background while the game ran. It could constantly detect the game's window coordinates and dimensions and adjust the mouse bounds accordingly. If I only knew more Visual Basic API language. :P
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Hollister Man on Wed 16/06/2004 04:55:43
Gil:  Its so far off the side that it actually becomes time-consuming to adjust it every time I test the game (everything from the tray over is placed off the screen when I switch back, if 640 is reasonably centered, crappola monitor {maxtech, it even has 1 pixel that doesn't work at all.})  I just need a new one :)
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Pumaman on Wed 16/06/2004 21:28:42
Interesting idea -- I guess it could be added as an option to the Setup program. Would anyone else find this useful though?
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: TerranRich on Wed 16/06/2004 23:07:17
Yes! I definitely would. So would anyone running 1600x1024 like me and running a hi-res game in windowed mode.
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Radiant on Thu 17/06/2004 11:37:53
Maybe an easier solution would be this: if AGS runs in windowed mode with a 320x200 screen, instead the interpreter could create a 420x300 screen and center the actual graphics in there. So you'll have all the edge you want.
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Ryukage on Sat 19/06/2004 00:04:18
Quote from: Radiant on Thu 17/06/2004 11:37:53
Maybe an easier solution would be this: if AGS runs in windowed mode with a 320x200 screen, instead the interpreter could create a 420x300 screen and center the actual graphics in there. So you'll have all the edge you want.


Yes, adding a margin around the game window, and then translating clicks in the margin to the nearest actual screen coordinate, seems like a better idea than restricting the mouse.  Probably more complicated to implement, but I for one would be really freaking annoyed, and I mean tear-the-cd-out-of-the-drive-and-throw-it-against-the-wall annoyed, if I encountered a program that confined the system mouse to it's own window, even it was just a default setting that could be turned off.
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Hollister Man on Sat 19/06/2004 03:35:27
Strangely, I didn't find it annoying at all, of course, I 'alt-tab' a lot, so I hardly noticed.
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Pumaman on Sat 19/06/2004 21:48:51
Adding some sort of border sounds reasonable to me -- it could probably be off by default, but optionally enabled in Setup.
Title: Re: Is it possible to 'lock' the mouse in window mode?
Post by: Ishmael on Thu 19/08/2004 14:52:28
Do make it script controlable also, somehow, atleast I like to provide the players with as much custimazation options for the game as possible.