Skip to content

Commit b3ed0c1

Browse files
authored
Add alt.isCursorVisible method (#139)
1 parent 121d22b commit b3ed0c1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

client/src/bindings/Main.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ static void ShowCursor(const v8::FunctionCallbackInfo<v8::Value>& info)
156156
}
157157
}
158158

159+
static void IsCursorVisible(const v8::FunctionCallbackInfo<v8::Value>& info)
160+
{
161+
V8_GET_ISOLATE_CONTEXT_IRESOURCE();
162+
163+
V8_RETURN_BOOLEAN(resource->CursorVisible());
164+
}
165+
159166
static void GetCursorPos(const v8::FunctionCallbackInfo<v8::Value>& info)
160167
{
161168
V8_GET_ISOLATE_CONTEXT_RESOURCE();
@@ -1028,6 +1035,7 @@ extern V8Module altModule("alt",
10281035
V8Helpers::RegisterFunc(exports, "toggleGameControls", &ToggleGameControls);
10291036
V8Helpers::RegisterFunc(exports, "toggleVoiceControls", &ToggleVoiceControls);
10301037
V8Helpers::RegisterFunc(exports, "showCursor", &ShowCursor);
1038+
V8Helpers::RegisterFunc(exports, "isCursorVisible", &IsCursorVisible);
10311039

10321040
V8Helpers::RegisterFunc(exports, "getCursorPos", &GetCursorPos);
10331041
V8Helpers::RegisterFunc(exports, "setCursorPos", &SetCursorPos);

0 commit comments

Comments
 (0)