Jump to content

almost got my program up and running just need one more thing..


Recommended Posts

Posted

Hi,

I got my program (my game up and running for the first time in visual studio) but the mouse locks into the bottom right of the screen..

I am certain I have to modify this part of the script but I need help with what to place there..

 

//Move the mouse to the center of the screen

window->SetMousePosition(context->GetWidth() / 2, context->GetHeight() / 2);

 

Thanks!

Posted

what I meant to put is that when I run the program it locks the mouse and I can't unlock it unless I ctrl+alt+Delete to end the program that way and I don't know how to take that function out or where to take it out from..

 

thank you for that useful link too!

Posted

i just noticed what i put didn't make much sense lol sorry

 

the main problem is i need help finding out what function to place so the mouse won't lock in the bottom right of the screen when the program is launched...

Posted

It should lock to the centre of the screen, are you using multiple monitors?

 

Also hitting escape or alt+F4 exits the program

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Posted

no I have a laptop i'm using,

this is the script that might have to be changed but i'm not sure:

 

//Move the mouse to the center of the screen

window->SetMousePosition(context->GetWidth() / 2, context->GetHeight() / 2);

 

 

Posted

Yes that is the part that centres the mouse.

Notice that it uses the context size divided by 2 (=the mid point of both sizes)

So off the mouse is really stuck on the lower corner then the context is twice as large as your screen

System:

Linux Mint 17 ( = Ubuntu 14.04 with cinnamon desktop ) Ubuntu 14.04, AMD HD 6850, i5 2500k

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...