C# Class GarrysModLuaShared.gui

The gui library is similar to the input library but features functions that are more focused on the mouse's interaction with GUI panels.
Show file Open project: OmegaExtern/gmod-csharp-binary-module

Public Methods

Method Description
ActivateGameUI ( LuaState luaState ) : void

Opens the game menu overlay.

EnableScreenClicker ( LuaState luaState, bool enabled ) : void

Enables the mouse cursor without restricting player movement, like using Sandbox's Context Menu.

HideGameUI ( LuaState luaState ) : void

Hides the game menu overlay.

InternalCursorMoved ( LuaState luaState, double deltaX, double deltaY ) : void

Simulates a mouse move with the given deltas.

InternalKeyCodePressed ( LuaState luaState, KEY key ) : void

Simulates a key press for the given key.

InternalKeyCodeReleased ( LuaState luaState, KEY key ) : void

Simulates a key release for the given key.

InternalKeyCodeTyped ( LuaState luaState, KEY key ) : void

Simulates a key type typing to the specified key.

InternalKeyTyped ( LuaState luaState, double code ) : void

Simulates a ASCII symbol writing. Use for write text in chat or VGUI. Don't work while console open!

InternalMouseDoublePressed ( LuaState luaState, MOUSE key ) : void

Simulates a double mouse key press for the given mouse key.

InternalMousePressed ( LuaState luaState, MOUSE key ) : void

Simulates a mouse key press for the given mouse key.

InternalMouseReleased ( LuaState luaState, MOUSE key ) : void

Simulates a mouse key release for the given mouse key.

InternalMouseWheeled ( LuaState luaState, double delta ) : void

Simulates a mouse wheel scroll with the given delta.

IsConsoleVisible ( LuaState luaState ) : bool

Returns whenever the console is visible.

IsGameUIVisible ( LuaState luaState ) : bool

Returns whenever the game menu overlay ( main menu ) is open or not.

MousePos ( LuaState luaState ) : double>.Tuple

Returns the cursor's position on the screen.

MousePos ( LuaState luaState, double &mouseX, double &mouseY ) : void

Returns the cursor's position on the screen.

MouseX ( LuaState luaState ) : double

Returns X component of the mouse position.

MouseY ( LuaState luaState ) : double

Returns Y component of the mouse position.

OpenURL ( LuaState luaState, string url ) : void

Opens specified URL in the steam overlay browser. The URL has to start with either "http://" or "https://".

SetMousePos ( LuaState luaState, double mouseX, double mouseY ) : void

Sets the cursor's position on the screen, relative to the topleft corner of the window.

Method Details

ActivateGameUI() public static method

Opens the game menu overlay.
public static ActivateGameUI ( LuaState luaState ) : void
luaState LuaState Pointer to lua_State struct.
return void

EnableScreenClicker() public static method

Enables the mouse cursor without restricting player movement, like using Sandbox's Context Menu.
public static EnableScreenClicker ( LuaState luaState, bool enabled ) : void
luaState LuaState Pointer to lua_State struct.
enabled bool Whether the cursor should be enabled or not (true = enable, false = disable).
return void

HideGameUI() public static method

Hides the game menu overlay.
public static HideGameUI ( LuaState luaState ) : void
luaState LuaState Pointer to lua_State struct.
return void

InternalCursorMoved() public static method

Simulates a mouse move with the given deltas.
public static InternalCursorMoved ( LuaState luaState, double deltaX, double deltaY ) : void
luaState LuaState Pointer to lua_State struct.
deltaX double The movement delta on the x axis.
deltaY double The movement delta on the y axis.
return void

InternalKeyCodePressed() public static method

Simulates a key press for the given key.
public static InternalKeyCodePressed ( LuaState luaState, KEY key ) : void
luaState LuaState Pointer to lua_State struct.
key KEY The key.
return void

InternalKeyCodeReleased() public static method

Simulates a key release for the given key.
public static InternalKeyCodeReleased ( LuaState luaState, KEY key ) : void
luaState LuaState Pointer to lua_State struct.
key KEY The key.
return void

InternalKeyCodeTyped() public static method

Simulates a key type typing to the specified key.
public static InternalKeyCodeTyped ( LuaState luaState, KEY key ) : void
luaState LuaState Pointer to lua_State struct.
key KEY The key.
return void

InternalKeyTyped() public static method

Simulates a ASCII symbol writing. Use for write text in chat or VGUI. Don't work while console open!
public static InternalKeyTyped ( LuaState luaState, double code ) : void
luaState LuaState Pointer to lua_State struct.
code double ASCII code of symbol, see .
return void

InternalMouseDoublePressed() public static method

Simulates a double mouse key press for the given mouse key.
public static InternalMouseDoublePressed ( LuaState luaState, MOUSE key ) : void
luaState LuaState Pointer to lua_State struct.
key MOUSE The key.
return void

InternalMousePressed() public static method

Simulates a mouse key press for the given mouse key.
public static InternalMousePressed ( LuaState luaState, MOUSE key ) : void
luaState LuaState Pointer to lua_State struct.
key MOUSE The key.
return void

InternalMouseReleased() public static method

Simulates a mouse key release for the given mouse key.
public static InternalMouseReleased ( LuaState luaState, MOUSE key ) : void
luaState LuaState Pointer to lua_State struct.
key MOUSE The key.
return void

InternalMouseWheeled() public static method

Simulates a mouse wheel scroll with the given delta.
public static InternalMouseWheeled ( LuaState luaState, double delta ) : void
luaState LuaState Pointer to lua_State struct.
delta double The amount of scrolling to simulate.
return void

IsConsoleVisible() public static method

Returns whenever the console is visible.
public static IsConsoleVisible ( LuaState luaState ) : bool
luaState LuaState Pointer to lua_State struct.
return bool

IsGameUIVisible() public static method

Returns whenever the game menu overlay ( main menu ) is open or not.
public static IsGameUIVisible ( LuaState luaState ) : bool
luaState LuaState Pointer to lua_State struct.
return bool

MousePos() public static method

Returns the cursor's position on the screen.
public static MousePos ( LuaState luaState ) : double>.Tuple
luaState LuaState Pointer to lua_State struct.
return double>.Tuple

MousePos() public static method

Returns the cursor's position on the screen.
public static MousePos ( LuaState luaState, double &mouseX, double &mouseY ) : void
luaState LuaState Pointer to lua_State struct.
mouseX double Mouse X coordinate.
mouseY double Mouse Y coordinate.
return void

MouseX() public static method

Returns X component of the mouse position.
public static MouseX ( LuaState luaState ) : double
luaState LuaState Pointer to lua_State struct.
return double

MouseY() public static method

Returns Y component of the mouse position.
public static MouseY ( LuaState luaState ) : double
luaState LuaState Pointer to lua_State struct.
return double

OpenURL() public static method

Opens specified URL in the steam overlay browser. The URL has to start with either "http://" or "https://".
public static OpenURL ( LuaState luaState, string url ) : void
luaState LuaState Pointer to lua_State struct.
url string URL to open.
return void

SetMousePos() public static method

Sets the cursor's position on the screen, relative to the topleft corner of the window.
public static SetMousePos ( LuaState luaState, double mouseX, double mouseY ) : void
luaState LuaState Pointer to lua_State struct.
mouseX double The X coordinate to move the cursor to.
mouseY double The Y coordinate to move the cursor to.
return void