set the locking state for current mouse cursor * * Set the locking state for current mouse cursor on a PC platform. * * This function locks or unlocks the mouse cursor to the center point of the window. While the cursor is locked, * mouse position updates will still be sent to the scripts as usual. * * @name window.set_mouse_lock * @param flag [type:boolean] The lock state for the mouse cu
| 183 | * @param flag [type:boolean] The lock state for the mouse cursor |
| 184 | */ |
| 185 | static int SetMouseLock(lua_State* L) |
| 186 | { |
| 187 | DM_LUA_STACK_CHECK(L, 0); |
| 188 | |
| 189 | bool flag = dmScript::CheckBoolean(L, 1); |
| 190 | |
| 191 | // Hiding the cursor is the same thing as locking it currently |
| 192 | if (flag) |
| 193 | { |
| 194 | dmHID::HideMouseCursor(g_Window.m_HidContext); |
| 195 | } |
| 196 | else |
| 197 | { |
| 198 | dmHID::ShowMouseCursor(g_Window.m_HidContext); |
| 199 | } |
| 200 | |
| 201 | return 0; |
| 202 | } |
| 203 | |
| 204 | /*# set the mode for screen dimming |
| 205 | * |
nothing calls this directly
no test coverage detected