Is it possible to 'lock' the mouse in window mode?

Started by Hollister Man, Wed 16/06/2004 02:38:08

Previous topic - Next topic

Hollister Man

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. :)
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Gregjazz

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.

Gilbert

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.

Hollister Man

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. :)
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Gilbert

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?

TerranRich

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
Status: Trying to come up with some ideas...

Hollister Man

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 :)
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Pumaman

Interesting idea -- I guess it could be added as an option to the Setup program. Would anyone else find this useful though?

TerranRich

Yes! I definitely would. So would anyone running 1600x1024 like me and running a hi-res game in windowed mode.
Status: Trying to come up with some ideas...

Radiant

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.

Ryukage

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.
Ninja Master Ryukage
"Flipping out and kicking off heads since 1996"

Hollister Man

Strangely, I didn't find it annoying at all, of course, I 'alt-tab' a lot, so I hardly noticed.
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Pumaman

Adding some sort of border sounds reasonable to me -- it could probably be off by default, but optionally enabled in Setup.

Ishmael

Do make it script controlable also, somehow, atleast I like to provide the players with as much custimazation options for the game as possible.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

SMF spam blocked by CleanTalk