Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
Blam::Input Namespace Reference

Namespace containing functions for handling input from keyboards, mice, etc. More...

Functions

BLAM void FireKeyPress (SDL_Keycode key)
 Fires a key press event. More...
 
BLAM void FireCharacterInput (char character)
 Fires a character input event. More...
 
BLAM void SetKeyState (SDL_Keycode key, bool down)
 Sets the pressed state of a key. More...
 
BLAM bool IsKeyDown (SDL_Keycode key)
 Checks if a given key is down. More...
 
BLAM void FireMouseClick (uint8_t button)
 Fires a MouseClickEvent. More...
 
BLAM void FireMouseMove (int x, int y)
 Fires a MouseMoveEvent. More...
 
BLAM void SetMouseButtonState (uint8_t button, bool down)
 Sets the mouse down state for a given mouse button. More...
 
BLAM bool IsMouseButtonDown (uint8_t button)
 Checks if a given mouse button is down. More...
 

Detailed Description

Namespace containing functions for handling input from keyboards, mice, etc.

Function Documentation

◆ FireCharacterInput()

void Blam::Input::FireCharacterInput ( char  character)

Fires a character input event.

Parameters
character- The character that was pressed.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FireKeyPress()

void Blam::Input::FireKeyPress ( SDL_Keycode  key)

Fires a key press event.

Parameters
key- The virtual key code that was pressed.
+ Here is the caller graph for this function:

◆ FireMouseClick()

void Blam::Input::FireMouseClick ( uint8_t  button)

Fires a MouseClickEvent.

Parameters
button- The mouse button that was pressed. Valid values can be seen in sdl2/SDL_mouse.h, all starting with SDL_BUTTON_.
+ Here is the caller graph for this function:

◆ FireMouseMove()

void Blam::Input::FireMouseMove ( int  x,
int  y 
)

Fires a MouseMoveEvent.

Should generally only be called from the engine input listeners.

Parameters
x- The distance the mouse has moved along the X axis.
y- The distance the mouse has moved along the Y axis.
+ Here is the caller graph for this function:

◆ IsKeyDown()

bool Blam::Input::IsKeyDown ( SDL_Keycode  key)

Checks if a given key is down.

Parameters
key- The keycode to check.
Returns
true if the key is currently pressed, otherwise returns false.
+ Here is the caller graph for this function:

◆ IsMouseButtonDown()

bool Blam::Input::IsMouseButtonDown ( uint8_t  button)

Checks if a given mouse button is down.

Parameters
button- The mouse button to check. Valid values can be seen in sdl2/SDL_mouse.h, all starting with SDL_BUTTON_.
Returns
true if the specified mouse button is down, otherwise returns false.
+ Here is the caller graph for this function:

◆ SetKeyState()

void Blam::Input::SetKeyState ( SDL_Keycode  key,
bool  down 
)

Sets the pressed state of a key.

Parameters
key- The keycode to set the state for.
down- Whether or not the key is currently being pressed.
+ Here is the caller graph for this function:

◆ SetMouseButtonState()

void Blam::Input::SetMouseButtonState ( uint8_t  button,
bool  down 
)

Sets the mouse down state for a given mouse button.

Parameters
button- The mouse button to set the state for. Valid values can be seen in sdl2/SDL_mouse.h, all starting with SDL_BUTTON_.
down- Whether or not the button is currently being pressed.
+ Here is the caller graph for this function: