PlayerInput

Namespace: Murder.Core.Input
Assembly: Murder.dll

public class PlayerInput

⭐ Constructors

public PlayerInput()

⭐ Properties

AllAxis

public Int32[] AllAxis { get; }

Returns
int[]

AllButtons

public Int32[] AllButtons { get; }

Returns
int[]

CursorPosition

public Point CursorPosition;

Cursor position on the screen. Null when using an ImGui window.

Returns
Point

KeyboardConsumed

public bool KeyboardConsumed;

Keyboard ignored because the player is probably typing something on ImGui

Returns
bool

MouseConsumed

public bool MouseConsumed;

Returns
bool

ScrollWheel

public int ScrollWheel { get; }

Scrollwheel delta

Returns
int

UsingKeyboard

public bool UsingKeyboard;

If true player is using the keyboard, false means the player is using a game controller

Returns
bool

⭐ Methods

Down(Keys)

public bool Down(Keys key)

Parameters
key Keys

Returns
bool

Down(int, bool)

public bool Down(int button, bool raw)

Parameters
button int
raw bool

Returns
bool

GridMenu(GenericMenuInfo`1&, int, int, GridMenuFlags)

public bool GridMenu(GenericMenuInfo`1& currentInfo, int width, int size, GridMenuFlags gridMenuFlags)

Parameters
currentInfo GenericMenuInfo<T>&
width int
size int
gridMenuFlags GridMenuFlags

Returns
bool

GridMenu(MenuInfo&, int, int, int, GridMenuFlags)

public bool GridMenu(MenuInfo& currentInfo, int width, int _, int size, GridMenuFlags gridMenuFlags)

Parameters
currentInfo MenuInfo&
width int
_ int
size int
gridMenuFlags GridMenuFlags

Returns
bool

HorizontalMenu(MenuInfo&)

public bool HorizontalMenu(MenuInfo& currentInfo)

Parameters
currentInfo MenuInfo&

Returns
bool

HorizontalMenu(Int32&, int)

public bool HorizontalMenu(Int32& selectedOption, int length)

Parameters
selectedOption int&
length int

Returns
bool

Pressed(Keys)

public bool Pressed(Keys enter)

Parameters
enter Keys

Returns
bool

Pressed(int, bool)

public bool Pressed(int button, bool raw)

Parameters
button int
raw bool

Returns
bool

PressedAndConsume(int)

public bool PressedAndConsume(int button)

Parameters
button int

Returns
bool

Released(int)

public bool Released(int button)

Parameters
button int

Returns
bool

Shortcut(Keys, Keys[])

public bool Shortcut(Keys key, Keys[] modifiers)

Parameters
key Keys
modifiers Keys[]

Returns
bool

Shortcut(Chord)

public bool Shortcut(Chord chord)

Parameters
chord Chord

Returns
bool

SimpleVerticalMenu(Int32&, int)

public bool SimpleVerticalMenu(Int32& selectedOption, int length)

Parameters
selectedOption int&
length int

Returns
bool

VerticalMenu(GenericMenuInfo`1&)

public bool VerticalMenu(GenericMenuInfo`1& currentInfo)

Parameters
currentInfo GenericMenuInfo<T>&

Returns
bool

VerticalMenu(MenuInfo&)

public bool VerticalMenu(MenuInfo& currentInfo)

Parameters
currentInfo MenuInfo&

Returns
bool

GetAxisDescriptor(int)

public string GetAxisDescriptor(int axis)

Parameters
axis int

Returns
string

GetButtonDescriptor(int)

public string GetButtonDescriptor(int button)

Parameters
button int

Returns
string

GetKeyboardInput()

public string GetKeyboardInput()

Returns
string

GetAxis(int)

public VirtualAxis GetAxis(int axis)

Parameters
axis int

Returns
VirtualAxis

GetOrCreateAxis(int)

public VirtualAxis GetOrCreateAxis(int axis)

Parameters
axis int

Returns
VirtualAxis

GetOrCreateButton(int)

public VirtualButton GetOrCreateButton(int button)

Parameters
button int

Returns
VirtualButton

Bind(int, Action)

public void Bind(int button, Action<T> action)

Parameters
button int
action Action<T>

ClampText(int)

public void ClampText(int size)

Parameters
size int

ClearBinds(int)

public void ClearBinds(int button)

Clears all binds from a button

Parameters
button int

Consume(int)

public void Consume(int button)

Consumes all buttons that have anything in common with this

Parameters
button int

ConsumeAll()

public void ConsumeAll()

ListenToKeyboardInput(bool, int)

public void ListenToKeyboardInput(bool enable, int maxCharacters)

Parameters
enable bool
maxCharacters int

Register(int, InputButtonAxis[])

public void Register(int axis, InputButtonAxis[] buttonAxes)

Registers input axes

Parameters
axis int
buttonAxes InputButtonAxis[]

Register(int, Buttons[])

public void Register(int button, Buttons[] buttons)

Registers a mouse button as a button

Parameters
button int
buttons Buttons[]

Register(int, Keys[])

public void Register(int button, Keys[] keys)

Registers a keyboard key as a button

Parameters
button int
keys Keys[]

Register(int, MouseButtons[])

public void Register(int button, MouseButtons[] buttons)

Parameters
button int
buttons MouseButtons[]

RegisterAxes(int, GamepadAxis[])

public void RegisterAxes(int axis, GamepadAxis[] gamepadAxis)

Registers a gamepad axis as a button

Parameters
axis int
gamepadAxis GamepadAxis[]

RegisterAxesAsButton(int, GamepadAxis[])

public void RegisterAxesAsButton(int button, GamepadAxis[] gamepadAxis)

Registers a gamepad axis as a button

Parameters
button int
gamepadAxis GamepadAxis[]

Update()

public void Update()