C# 클래스 GarrysModLuaShared.input

The input library allows you to gather information about the clients input devices (mouse & keyboard), such as the cursor position and whether a key is pressed or not.
파일 보기 프로젝트 열기: OmegaExtern/gmod-csharp-binary-module

공개 메소드들

메소드 설명
CheckKeyTrapping ( LuaState luaState ) : KEY

Returns the last key captured by key trapping.

GetCursorPos ( LuaState luaState ) : double>.Tuple

Returns the cursor's position on the screen.

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

Returns the cursor's position on the screen.

GetKeyName ( LuaState luaState, BUTTON button ) : string

Gets the name of the button index.

IsButtonDown ( LuaState luaState, BUTTON button ) : bool

Gets whether the specified button code is down. Unlike input.IsKeyDown this can also detect joystick presses from JOYSTICK enum.

IsControlDown ( LuaState luaState ) : bool

Returns whether a control key is being pressed.

IsKeyDown ( LuaState luaState, KEY key ) : bool

Gets whether a key is down.

IsKeyTrapping ( LuaState luaState ) : bool

Returns whether key trapping is activate and the next key press will be captured.

IsMouseDown ( LuaState luaState, MOUSE mouseKey ) : bool

Gets whether a mouse button is down.

IsShiftDown ( LuaState luaState ) : bool

Gets whether a shift key is being pressed.

LookupBinding ( LuaState luaState, string binding, bool exact = false ) : string

Gets the match uppercase key for the specified binding.

LookupKeyBinding ( LuaState luaState, KEY key ) : string

Returns the bind string that the given key is bound to.

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

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

StartKeyTrapping ( LuaState luaState ) : void

Starts key trap.

WasKeyPressed ( LuaState luaState, KEY key ) : bool

Returns whether a key was initially pressed in the same frame this function was called. This function only works in Move hooks, and will detect key presses even in main menu or when a typing in a text field.

WasKeyReleased ( LuaState luaState, KEY key ) : bool

Returns whether a key was released in the same frame this function was called. This function only works in Move hooks, and will detect key releases even in main menu or when a typing in a text field.

WasKeyTyped ( LuaState luaState, KEY key ) : bool

Returns whether the key is being held down or not. This function only works in Move hooks, and will detect key events even in main menu or when a typing in a text field.

WasMouseDoublePressed ( LuaState luaState, MOUSE button ) : bool

Returns whether a mouse key was double pressed in the same frame this function was called. If this function returns true, WasMousePressed will return false. This function only works in Move hooks, and will detect mouse events even in main menu or when a typing in a text field.

WasMousePressed ( LuaState luaState, MOUSE button ) : bool

Returns whether a mouse key was initially pressed in the same frame this function was called. If WasMouseDoublePressed returns true, this function will return false. This function only works in Move hooks, and will detect mouse events even in main menu or when a typing in a text field.

메소드 상세

CheckKeyTrapping() 공개 정적인 메소드

Returns the last key captured by key trapping.
public static CheckKeyTrapping ( LuaState luaState ) : KEY
luaState LuaState Pointer to lua_State struct.
리턴 KEY

GetCursorPos() 공개 정적인 메소드

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

GetCursorPos() 공개 정적인 메소드

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

GetKeyName() 공개 정적인 메소드

Gets the name of the button index.
public static GetKeyName ( LuaState luaState, BUTTON button ) : string
luaState LuaState Pointer to lua_State struct.
button BUTTON The button.
리턴 string

IsButtonDown() 공개 정적인 메소드

Gets whether the specified button code is down. Unlike input.IsKeyDown this can also detect joystick presses from JOYSTICK enum.
public static IsButtonDown ( LuaState luaState, BUTTON button ) : bool
luaState LuaState Pointer to lua_State struct.
button BUTTON The button, valid values are in the range of enum.
리턴 bool

IsControlDown() 공개 정적인 메소드

Returns whether a control key is being pressed.
public static IsControlDown ( LuaState luaState ) : bool
luaState LuaState Pointer to lua_State struct.
리턴 bool

IsKeyDown() 공개 정적인 메소드

Gets whether a key is down.
public static IsKeyDown ( LuaState luaState, KEY key ) : bool
luaState LuaState Pointer to lua_State struct.
key KEY The key.
리턴 bool

IsKeyTrapping() 공개 정적인 메소드

Returns whether key trapping is activate and the next key press will be captured.
public static IsKeyTrapping ( LuaState luaState ) : bool
luaState LuaState Pointer to lua_State struct.
리턴 bool

IsMouseDown() 공개 정적인 메소드

Gets whether a mouse button is down.
public static IsMouseDown ( LuaState luaState, MOUSE mouseKey ) : bool
luaState LuaState Pointer to lua_State struct.
mouseKey MOUSE The mouse key.
리턴 bool

IsShiftDown() 공개 정적인 메소드

Gets whether a shift key is being pressed.
public static IsShiftDown ( LuaState luaState ) : bool
luaState LuaState Pointer to lua_State struct.
리턴 bool

LookupBinding() 공개 정적인 메소드

Gets the match uppercase key for the specified binding.
public static LookupBinding ( LuaState luaState, string binding, bool exact = false ) : string
luaState LuaState Pointer to lua_State struct.
binding string The binding name.
exact bool True if the binding should match exactly.
리턴 string

LookupKeyBinding() 공개 정적인 메소드

Returns the bind string that the given key is bound to.
public static LookupKeyBinding ( LuaState luaState, KEY key ) : string
luaState LuaState Pointer to lua_State struct.
key KEY The key.
리턴 string

SetCursorPos() 공개 정적인 메소드

Sets the cursor's position on the screen, relative to the topleft corner of the window.
public static SetCursorPos ( LuaState luaState, double mouseX, double mouseY ) : void
luaState LuaState Pointer to lua_State struct.
mouseX double X coordinate for mouse position.
mouseY double Y coordinate for mouse position.
리턴 void

StartKeyTrapping() 공개 정적인 메소드

Starts key trap.
public static StartKeyTrapping ( LuaState luaState ) : void
luaState LuaState Pointer to lua_State struct.
리턴 void

WasKeyPressed() 공개 정적인 메소드

Returns whether a key was initially pressed in the same frame this function was called. This function only works in Move hooks, and will detect key presses even in main menu or when a typing in a text field.
public static WasKeyPressed ( LuaState luaState, KEY key ) : bool
luaState LuaState Pointer to lua_State struct.
key KEY The key.
리턴 bool

WasKeyReleased() 공개 정적인 메소드

Returns whether a key was released in the same frame this function was called. This function only works in Move hooks, and will detect key releases even in main menu or when a typing in a text field.
public static WasKeyReleased ( LuaState luaState, KEY key ) : bool
luaState LuaState Pointer to lua_State struct.
key KEY The key.
리턴 bool

WasKeyTyped() 공개 정적인 메소드

Returns whether the key is being held down or not. This function only works in Move hooks, and will detect key events even in main menu or when a typing in a text field.
public static WasKeyTyped ( LuaState luaState, KEY key ) : bool
luaState LuaState Pointer to lua_State struct.
key KEY The key.
리턴 bool

WasMouseDoublePressed() 공개 정적인 메소드

Returns whether a mouse key was double pressed in the same frame this function was called. If this function returns true, WasMousePressed will return false. This function only works in Move hooks, and will detect mouse events even in main menu or when a typing in a text field.
public static WasMouseDoublePressed ( LuaState luaState, MOUSE button ) : bool
luaState LuaState Pointer to lua_State struct.
button MOUSE The mouse button to test.
리턴 bool

WasMousePressed() 공개 정적인 메소드

Returns whether a mouse key was initially pressed in the same frame this function was called. If WasMouseDoublePressed returns true, this function will return false. This function only works in Move hooks, and will detect mouse events even in main menu or when a typing in a text field.
public static WasMousePressed ( LuaState luaState, MOUSE button ) : bool
luaState LuaState Pointer to lua_State struct.
button MOUSE The mouse button to test.
리턴 bool