Hello, I need to change mouse sensitivity, how I can do this?
Thanks for help in advanced
How I can change mouse sensitivity?
Moderators: CEGUI MVP, CEGUI Team
Rackle wrote:When you inject mouse movement you can multiply by a value. Me I like to multiply by 1.75:
injectMouseMove(arg.state.X.rel * 1.75, arg.state.Y.rel * 1.75)
A better approach would be to use a variable, with a user interface component to allow users to specify their own multiplicator.
It doesn't work. Is there something wrong in my next actions?
void CABDemoApp::UpdateCEGUISize(int nWidth, int nHeight)
{
CEGUI::Size sz((float)nWidth, (float)nHeight);
static_cast<CEGUI::DirectX81Renderer*>(m_pGuiRenderer)->setDisplaySize(sz);
CEGUI::Rect rect(0.0f, 0.0f, sz.d_width, sz.d_height);
CEGUI::MouseCursor::getSingleton().setConstraintArea(&rect);
CEGUI::System::getSingleton().injectMouseMove(sz.d_width * 0.5, sz.d_height * 0.5);
CEGUI::System::getSingleton().signalRedraw();
}
Is your UpdateCEGUISize() function called every frame or only when the display window is resized? My guess is that you are not injecting the mouse movement every time the mouse is moved. Also, multiplying by 0.5 would reduce the speed at which the mouse moves by half, and multiplying by 1.5 would double its speed.
Rackle wrote:Is your UpdateCEGUISize() function called every frame or only when the display window is resized? My guess is that you are not injecting the mouse movement every time the mouse is moved. Also, multiplying by 0.5 would reduce the speed at which the mouse moves by half, and multiplying by 1.5 would double its speed.
Oh yeah, I'm miss it. Now I put this line into every frame, in main cycle, but it doesn't work!!! Maybe I do somesing wrong?
Das Gurke wrote:What about CEGUI::System::setMouseMoveScaling ? Wouldn't that be the far easiest method?
Yeah, this is more correct variant which specially destination for this. But this don't work. May you now why?
P.S. Help, please, but I relly need it!!!
Das Gurke wrote:1) Stupid Question, but: Does your mouse move at all? (Just to make sure)
Yes, mouse moving, but it speed don't changed.
Das Gurke wrote:2) Have you tried some "crazy" values like 200 or 0.00001f?
I tried anything values, begining at 0.01f to 1000000, speed don't changed.
Last edited by Vetal_28 on Thu Apr 19, 2007 15:57, edited 1 time in total.
Rackle wrote:You need to post some more code...
I tried for 2 ways:
1-st at initialization CEGUI:
void CABDemoApp::InitCEGUI()
{
InitCEGUIRender();
CreateInterface();
InitDialogs();
CEGUI::System::getSingleton().setMouseMoveScaling(100);
SetMusicVolumeInScript();
SetSoundVolumeInScript();
SetDetailedGrapic();
}
2-st directly at event MouseMove
case N_INPUT_MOUSE_MOVE:
CEGUI::System::getSingleton().injectMousePosition(
static_cast<float>(pEvent->GetAbsXPos()),
static_cast<float>(pEvent->GetAbsYPos()));
CEGUI::System::getSingleton().injectMouseMove(pEvent->GetAbsXPos() * 0.1f, pEvent->GetAbsYPos() * 0.1f);
break;
If this code wiil not help, and if you have a time, I can send any files from code, maybe this way can resolve my problem. If you be able help me, I will be very grateful to you!
You need to supply absolute mouse position or relative mouse movement, but not both. Unfortunately the code for the relative mouse position, the call to the injectMouseMove() function, is incorrect since you are passing absolute positions.
case N_INPUT_MOUSE_MOVE:
CEGUI::System::getSingleton().injectMousePosition(static_cast<float>(pEvent->GetAbsXPos()), static_cast<float>(pEvent->GetAbsYPos()));
CEGUI::System::getSingleton().injectMouseMove(pEvent->GetAbsXPos() * 0.1f, pEvent->GetAbsYPos() * 0.1f);
break;
case N_INPUT_MOUSE_MOVE:
CEGUI::System::getSingleton().injectMousePosition(static_cast<float>(pEvent->GetAbsXPos()), static_cast<float>(pEvent->GetAbsYPos()));
CEGUI::System::getSingleton().injectMouseMove(pEvent->GetAbsXPos() * 0.1f, pEvent->GetAbsYPos() * 0.1f);
break;
Rackle wrote:You need to supply absolute mouse position or relative mouse movement, but not both. Unfortunately the code for the relative mouse position, the call to the injectMouseMove() function, is incorrect since you are passing absolute positions.
case N_INPUT_MOUSE_MOVE:
CEGUI::System::getSingleton().injectMousePosition(static_cast<float>(pEvent->GetAbsXPos()), static_cast<float>(pEvent->GetAbsYPos()));
CEGUI::System::getSingleton().injectMouseMove(pEvent->GetAbsXPos() * 0.1f, pEvent->GetAbsYPos() * 0.1f);
break;
I tryied all variants, if I leave:
case N_INPUT_MOUSE_MOVE:
CEGUI::System::getSingleton().injectMouseMove(pEvent->GetAbsXPos() * 0.5f, pEvent->GetAbsXPos() * 0.5f);
break;
then mouse doesn't show, and accordingly doesn't move. You writing that injectMouseMove() function is incorrect, I think the same to:). And how wiil be the correct variant? What parametrs will have injectMouseMove() function? and where I can take their?
\param delta_x
amount the mouse moved on the x axis.
\param delta_y
amount the mouse moved on the y axis.
I don't see it.
Who is online
Users browsing this forum: No registered users and 1 guest