doodle  0.2
Intended to support teaching C++, doodle is a simple library that helps make a window and makes it easy to do some drawing.
Namespaces | Enumerations | Functions | Variables
input.hpp File Reference
#include <doodle/eventhook.hpp>
#include <functional>
#include <string>

Go to the source code of this file.

Namespaces

 doodle
 

Enumerations

enum class  doodle::MouseButtons { doodle::None , doodle::Left , doodle::Middle , doodle::Right , doodle::Count }
 
enum class  doodle::KeyboardButtons {
  doodle::None , doodle::_0 , doodle::_1 , doodle::_2 , doodle::_3 , doodle::_4 , doodle::_5 , doodle::_6 , doodle::_7 , doodle::_8 , doodle::_9 , doodle::A , doodle::B , doodle::C , doodle::D , doodle::E , doodle::F , doodle::G , doodle::H , doodle::I ,
  doodle::J , doodle::K , doodle::L , doodle::M , doodle::N , doodle::O , doodle::P , doodle::Q , doodle::R , doodle::S , doodle::T , doodle::U , doodle::V , doodle::W , doodle::X , doodle::Y , doodle::Z , doodle::NumPad_0 , doodle::NumPad_1 , doodle::NumPad_2 ,
  doodle::NumPad_3 , doodle::NumPad_4 , doodle::NumPad_5 , doodle::NumPad_6 , doodle::NumPad_7 , doodle::NumPad_8 , doodle::NumPad_9 , doodle::Escape , doodle::Control , doodle::Shift , doodle::CapsLock , doodle::LeftSystem , doodle::RightSystem , doodle::Menu , doodle::LeftBracket , doodle::RightBracket , doodle::Semicolon , doodle::Comma , doodle::Period , doodle::Quote ,
  doodle::Slash , doodle::Backslash , doodle::Tilde , doodle::Equal , doodle::Hyphen , doodle::Space , doodle::Enter , doodle::Backspace , doodle::Tab , doodle::PageUp , doodle::PageDown , doodle::End , doodle::Home , doodle::PrintScreen , doodle::Insert , doodle::Delete , doodle::Add , doodle::Subtract , doodle::Multiply , doodle::Divide ,
  doodle::Left , doodle::Right , doodle::Up , doodle::Down , doodle::F1 , doodle::F2 , doodle::F3 , doodle::F4 , doodle::F5 , doodle::F6 , doodle::F7 , doodle::F8 , doodle::F9 , doodle::Pause , doodle::Count
}
 

Functions

std::string doodle::to_string (MouseButtons button) noexcept
 Convert MouseButtons enum to std::string. More...
 
std::string doodle::to_string (KeyboardButtons button) noexcept
 Convert KeboardButtons enum to std::string. More...
 
std::wstring doodle::to_wstring (MouseButtons button) noexcept
 Convert MouseButtons enum to std::wstring. More...
 
std::wstring doodle::to_wstring (KeyboardButtons button) noexcept
 Convert KeboardButtons enum to std::wstring. More...
 
int doodle::get_mouse_x () noexcept
 Get the mouse's X position relative to the currently set doodle::FrameOfReference. More...
 
int doodle::get_mouse_y () noexcept
 Get the mouse's Y position relative to the currently set doodle::FrameOfReference. More...
 
int doodle::get_previous_mouse_x () noexcept
 Get the previous mouse's X position relative to the currently set doodle::FrameOfReference. More...
 
int doodle::get_previous_mouse_y () noexcept
 Get the previous mouse's Y position relative to the currently set doodle::FrameOfReference. More...
 
void doodle::set_callback_key_pressed (std::function< void(KeyboardButtons)> &&callback) noexcept
 The provided callback function is called once every time a key is pressed. More...
 
void doodle::set_callback_key_released (std::function< void(KeyboardButtons)> &&callback) noexcept
 The provided callback function is called once every time a key is released. More...
 
void doodle::set_callback_mouse_moved (std::function< void(int, int)> &&callback) noexcept
 The provided callback function is called every time the mouse moves. More...
 
void doodle::set_callback_mouse_pressed (std::function< void(MouseButtons)> &&callback) noexcept
 The provided callback is called whenever a mouse button is pressed. More...
 
void doodle::set_callback_mouse_released (std::function< void(MouseButtons)> &&callback) noexcept
 The provided callback is called whenever a mouse button is released. More...
 
void doodle::set_callback_mouse_wheel (std::function< void(int)> &&callback) noexcept
 The provided callback is called whenever the mouse wheel is scrolled. More...
 
EVENT_HOOK void on_key_pressed (doodle::KeyboardButtons button)
 The declaration of the optional on_key_pressed function to implement in your doodle program. More...
 
EVENT_HOOK void on_key_released (doodle::KeyboardButtons button)
 The declaration of the optional on_key_released function to implement in your doodle program. More...
 
EVENT_HOOK void on_mouse_moved (int mouse_x, int mouse_y)
 The declaration of the optional on_mouse_moved function to implement in your doodle program. More...
 
EVENT_HOOK void on_mouse_pressed (doodle::MouseButtons button)
 The declaration of the optional on_mouse_pressed function to implement in your doodle program. More...
 
EVENT_HOOK void on_mouse_released (doodle::MouseButtons button)
 The declaration of the optional on_mouse_released function to implement in your doodle program. More...
 
EVENT_HOOK void on_mouse_wheel (int scroll_amount)
 The declaration of the optional on_mouse_wheel function to implement in your doodle program. More...
 

Variables

bool doodle::MouseIsPressed
 The boolean system variable MouseIsPressed is true if the mouse is pressed and false if not. More...
 
bool doodle::KeyIsPressed
 The boolean system variable KeyIsPressed is true if any key is pressed and false if no keys are pressed. More...
 
KeyboardButtons doodle::Key
 The system variable key always contains the value of the most recent key on the keyboard that was typed. More...
 
MouseButtons doodle::MouseButton
 doodle automatically tracks if the mouse button is pressed and which button is pressed. The value of the system variable MouseButton is either LEFT, RIGHT, or CENTER depending on which button was pressed last. More...