Windows mouse locking doesn't work

Discussion in 'Windows Virtual Machine' started by ignas2526, Nov 5, 2012.

  1. ignas2526

    ignas2526 Bit poster

    Messages:
    8
    Hello,
    I'm working on a OpenGL application and I'm having difficulties with changing mouse position(mouse locking).
    Application is not in the fullscreen mode, when SmartMouse is On or on Auto it doesn't let me lock the mouse, if I turn SmartMosue Off it works as expected.
    I'm using SetCursorPos function, here's C code:
    Is there any way to lock position of the mouse when SmartMouse is on?
    Thanks.
     
    Last edited: Nov 5, 2012
  2. serv

    serv Forum Maven

    Messages:
    817
    When Smart Mouse is On or Auto, mouse cursor is controlled by host mouse only.
    When Smart Mouse is set to Auto and cursor is hidden, mouse is effectively locked it in VM. But you'll have to draw cursor in your program' window somehow.
    When Smart Mouse is off, mouse cursor is fully controlled by VM.
     
  3. ignas2526

    ignas2526 Bit poster

    Messages:
    8
    Thanks, it worked!
    In case someone has similar problem, call this function once: ShowCursor(0); somewhere before SetCursorPos.
     

Share This Page