Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
Namespaces | Functions | Variables
event_handler.cpp File Reference
#include <spdlog/spdlog.h>
#include "event_handler.h"
#include "app_workspace.h"
#include "gui_input.h"
#include "gui_button.h"
#include "gui_combobox.h"
#include "localisation.h"
#include "imgui.h"
#include "imgui_internal.h"
#include "gui_direct.h"
#include "gui_label.h"
#include "gui_observer.h"
#include "gui_selectable.h"

Go to the source code of this file.

Namespaces

 event_handler
 

Functions

template<typename Base , typename T >
bool event_handler::instanceof (const T *ptr)
 
SDL_Scancode event_handler::determine_scancode (uint16_t keycode, uint8_t cycle=0)
 Determines SDL_Scancode from SPI keyboard keycode and cycle. Cycle is used to cycle keys during text input. More...
 
SDL_Event event_handler::create_key_event (SDL_Scancode scancode, Uint16 mod=0)
 Creates an SDL_Event simulating keyboard press from SDL_Scancode. More...
 
SDL_Event event_handler::create_textinput_event (SDL_Scancode scancode)
 Creates an SDL_Event for input. More...
 
void event_handler::push_event_to_sdl (SDL_Event *event, bool replace_cur_char=false)
 Pushes event to SDL queue. This event then can be propagated to ImGui. If @replace_cur_char is set, ten a BACKSPACE event is pushed first. More...
 
bool event_handler::can_switch_modes ()
 Determine if keyboard can be switched to INPUT mode. More...
 
int event_handler::handle_return_event ()
 Handles return event (NAVIGATION/INPUT mode switch, BUTTON/ COMBOOX... activation) More...
 
int event_handler::handle_nav_event (kb_event *raw_event)
 Handle event as navigation event. More...
 
int event_handler::handle_input_event (kb_event *raw_event)
 Handle event as input event. More...
 
int event_handler::handle_raw_event (kb_event *raw_event)
 Offers option for cutom event handling. If not desired only created SDL event. More...
 
int event_handler::handle_sdl_event (const SDL_Event *event)
 Handles SDL2 library event. More...
 
int event_handler::focused_element_action (gui_element *element)
 
int event_handler::rfid_action_user_logged (rfid_event *event)
 
int event_handler::handle_rfid_event (rfid_event *event)
 Function handles RFID event. More...
 

Variables

std::map< uint16_t, SDL_Scancode > event_handler::navigation_keymap
 Map for translating SPI keyboard scancodes keys to SDL scancodes for navigation. More...
 
std::map< uint16_t, SDL_Scancode > event_handler::int_in_keymap
 int input map that is used for mapping spi keys to sdl scancodes More...
 
std::map< uint16_t, SDL_Scancode > event_handler::float_in_keymap
 float input map that is used for mapping spi keys to sdl scancodes More...
 
std::map< uint16_t, std::vector< SDL_Scancode > > event_handler::text_in_keymap
 Text input keymap. Holds what scancodes are cycled for corresponding key. First value should correspond to the physical key value ("picture" on keyboard). Some keys are currently disabled. Either because they are reserved or have no use. More...
 
std::map< SDL_Scancode, const char * > event_handler::custom_keymap
 
std::map< SDL_Scancode, const char * > event_handler::custom_shift_keymap