Adonthell  0.4
input Class Reference

Handles keyboard and mouse input. More...

#include <input.h>

Static Public Member Functions

static void init ()
 Initialise the input system. More...
 
static void shutdown ()
 Free resources occupied by the input system. More...
 
static void update ()
 Update the input state. More...
 
static bool is_pushed (SDL_Keycode key)
 Returns whether a key is currently pushed or not. More...
 
static bool has_been_pushed (SDL_Keycode key)
 Returns whether a key has been pushed since last function call, false otherwise. More...
 
static SDL_Keycode get_next_key ()
 Returns the code of the next key on the input queue. More...
 
static std::string get_next_unicode ()
 Returns the next text input on the input queue encoded as utf8. More...
 
static void start_text_input ()
 
static void stop_text_input ()
 
static bool is_text_input ()
 
static void clear_keys_queue ()
 Totally clears the key queue. More...
 

Detailed Description

Handles keyboard and mouse input.

Todo:
Rewrite it!

Definition at line 47 of file input.h.

Member Function Documentation

◆ init()

void input::init ( )
static

Initialise the input system.

Definition at line 48 of file input.cc.

◆ shutdown()

void input::shutdown ( )
static

Free resources occupied by the input system.

Definition at line 59 of file input.cc.

◆ update()

void input::update ( )
static

Update the input state.

Definition at line 64 of file input.cc.

◆ is_pushed()

bool input::is_pushed ( SDL_Keycode  key)
static

Returns whether a key is currently pushed or not.

Parameters
keykey to test.
Returns
true if key is currently pushed, false otherwise.

Definition at line 110 of file input.cc.

◆ has_been_pushed()

bool input::has_been_pushed ( SDL_Keycode  key)
static

Returns whether a key has been pushed since last function call, false otherwise.

Parameters
keykey to test.
Returns
true if the key has been pushed since last call, false otherwise.

Definition at line 119 of file input.cc.

◆ get_next_key()

SDL_Keycode input::get_next_key ( )
static

Returns the code of the next key on the input queue.

Returns
Code of the next key that has been pushed.

Definition at line 128 of file input.cc.

◆ get_next_unicode()

std::string input::get_next_unicode ( )
static

Returns the next text input on the input queue encoded as utf8.

Returns
utf8 representation of the next character that has been input.

Definition at line 143 of file input.cc.

◆ clear_keys_queue()

void input::clear_keys_queue ( )
static

Totally clears the key queue.

Definition at line 168 of file input.cc.


The documentation for this class was generated from the following files: