Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Lock mouse on screen with dual monitor setup

Author
Message
Chibi Babble
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location:
Posted: 31st Jul 2010 04:53
On a dual monitor setup, how do you lock the mouse onto the screen or at least make it so you can't click outside the screen?

Chibi?
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 31st Jul 2010 19:57
The best you can do is to use POSITION MOUSE to try and keep it within the window - that won't stop the mouse going outside the window, but it will immediately bring it back if it is.

Levanthus
23
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 31st Jul 2010 20:59
i use a dual monitor setup also, i just use position mouse x,y and it stays pretty much where you position it, i'm not too sure about it straying outside of the window, every time i use it, it never stays EXACTLY in the point i put it but it judders about a bit, but never too far from where i put it

I can see from your smile, you're not here for the sunset

Windows 7 64 bit, AMD Phenom II x4 Black edition, 4 GB Ram, Radeon HD 4650, 540 GB HDD
Chibi Babble
23
Years of Service
User Offline
Joined: 1st Feb 2003
Location:
Posted: 31st Jul 2010 21:34
Thanks. Maybe something that should be added in a future update =)

I have to say I'm amazed that after pretty much a decade its nice to see dark basic is still supported and kicking =)

Chibi?
bitJericho
23
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 1st Aug 2010 14:44 Edited at: 1st Aug 2010 14:46
Quote: "Thanks. Maybe something that should be added in a future update =)"


You can get around this by making your own mouse routines using the position mouse command and the mouse move functions and using a sprite or something similar.

Instead of positioning the mouse using the mouse x/y commands, keep an internal variable that changes with the mouse move commands.

That way, you can position the sprite within your window or any other confines you like.

The user still sees their own mouse when it moves outside the window, but by using the position mouse commands, this will be pretty difficult for the user to do.

All that said, it might frustrate the user to no end that they can't use the mouse outside the window.

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 2nd Aug 2010 19:43
Quote: "The user still sees their own mouse when it moves outside the window,"

Not if you use the command 'Hide Mouse' to hide the windows mouse, then use a sprite (Or something, in combination with the mousemove commands and position mouse) as your cursor.

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2026-07-25 08:29:24
Your offset time is: 2026-07-25 08:29:24