Author Topic: mouse capture so we wont have to hold right click all time  (Read 11 times)

Offline kinfuyuki789

  • Forum Newcomer
  • *
  • Posts: 1
  • Floof-O-Meter: 0
    • View Profile
mouse capture so we wont have to hold right click all time
« on: April 24, 2024, 05:38:54 am »
it is just a cool feature suggestion to add some immersion, to add a hotkey it is easy, i saw this game was made probably in c++ since is made in ogre and have irrlicht sound lib

so do something like this:


switch (input){
 case key_mouselock:
  mouselocked=!mouselocked;
  lookaround=mouselocked;
  mouse.x=200;
  mouse.y=200;
  break;
 case mouse_move:
  if (!mouselocked) movepointer();
  break;
 case rightmouse:
  if (!mouselocked) lookaround=!lookaround;
  break;
}

(it took a while to color everything but it looks great at least)

as you can see i made like... all input things i said being handled here so its easier to understand what i mean ^^
« Last Edit: April 24, 2024, 05:43:16 am by kinfuyuki789 »