Raspberry Pi Weighting Control System
This project serves as a simple weighting control system, that was realized as a Bachelor Thesis
|
Functions | |
template<typename Base , typename T > | |
bool | instanceof (const T *ptr) |
SDL_Scancode | 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 | create_key_event (SDL_Scancode scancode, Uint16 mod=0) |
Creates an SDL_Event simulating keyboard press from SDL_Scancode. More... | |
SDL_Event | create_textinput_event (SDL_Scancode scancode) |
Creates an SDL_Event for input. More... | |
void | 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 | can_switch_modes () |
Determine if keyboard can be switched to INPUT mode. More... | |
int | handle_return_event () |
Handles return event (NAVIGATION/INPUT mode switch, BUTTON/ COMBOOX... activation) More... | |
int | handle_nav_event (kb_event *raw_event) |
Handle event as navigation event. More... | |
int | handle_input_event (kb_event *raw_event) |
Handle event as input event. More... | |
int | handle_raw_event (kb_event *raw_event) |
Offers option for cutom event handling. If not desired only created SDL event. More... | |
int | handle_sdl_event (const SDL_Event *event) |
Handles SDL2 library event. More... | |
int | focused_element_action (gui_element *element) |
int | rfid_action_user_logged (rfid_event *event) |
int | handle_rfid_event (rfid_event *event) |
Function handles RFID event. More... | |
Variables | |
std::map< uint16_t, SDL_Scancode > | navigation_keymap |
Map for translating SPI keyboard scancodes keys to SDL scancodes for navigation. More... | |
std::map< uint16_t, SDL_Scancode > | int_in_keymap |
int input map that is used for mapping spi keys to sdl scancodes More... | |
std::map< uint16_t, SDL_Scancode > | 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 > > | 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 * > | custom_keymap |
std::map< SDL_Scancode, const char * > | custom_shift_keymap |
bool event_handler::can_switch_modes | ( | ) |
Determine if keyboard can be switched to INPUT mode.
Definition at line 502 of file event_handler.cpp.
SDL_Event event_handler::create_key_event | ( | SDL_Scancode | scancode, |
Uint16 | mod = 0 |
||
) |
Creates an SDL_Event simulating keyboard press from SDL_Scancode.
scancode | scancode of keyboard key |
mod |
Definition at line 418 of file event_handler.cpp.
SDL_Event event_handler::create_textinput_event | ( | SDL_Scancode | scancode | ) |
Creates an SDL_Event for input.
scancode | input value |
Definition at line 431 of file event_handler.cpp.
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.
keycode | SPI keyboard |
cycle | repeted pressed withnin a time limit |
Definition at line 381 of file event_handler.cpp.
int event_handler::focused_element_action | ( | gui_element * | element | ) |
element |
Definition at line 525 of file event_handler.cpp.
int event_handler::handle_input_event | ( | kb_event * | raw_event | ) |
Handle event as input event.
Definition at line 666 of file event_handler.cpp.
int event_handler::handle_nav_event | ( | kb_event * | raw_event | ) |
Handle event as navigation event.
Definition at line 635 of file event_handler.cpp.
int event_handler::handle_raw_event | ( | kb_event * | raw_event | ) |
Offers option for cutom event handling. If not desired only created SDL event.
Function that handles SPI keyboard event.
raw_event | SPI keyboard event |
raw_event | SPI kb event |
Definition at line 242 of file event_handler.cpp.
int event_handler::handle_return_event | ( | ) |
Handles return event (NAVIGATION/INPUT mode switch, BUTTON/ COMBOOX... activation)
Definition at line 579 of file event_handler.cpp.
int event_handler::handle_rfid_event | ( | rfid_event * | event | ) |
Function handles RFID event.
event | RFID event, contains rfid_tag structure |
Definition at line 762 of file event_handler.cpp.
int event_handler::handle_sdl_event | ( | const SDL_Event * | event | ) |
Handles SDL2 library event.
event | SDL event |
Definition at line 298 of file event_handler.cpp.
|
inline |
Definition at line 19 of file event_handler.cpp.
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.
event | |
replace_cur_char |
Definition at line 468 of file event_handler.cpp.
int event_handler::rfid_action_user_logged | ( | rfid_event * | event | ) |
Definition at line 717 of file event_handler.cpp.
std::map<SDL_Scancode, const char*> event_handler::custom_keymap |
This map is used to create a character input for SDL scancode
Definition at line 161 of file event_handler.cpp.
std::map<SDL_Scancode, const char*> event_handler::custom_shift_keymap |
This map is used when the SHIFT keymoad is toggled (true)
Definition at line 168 of file event_handler.cpp.
std::map<uint16_t, SDL_Scancode> event_handler::float_in_keymap |
float input map that is used for mapping spi keys to sdl scancodes
Definition at line 110 of file event_handler.cpp.
std::map<uint16_t, SDL_Scancode> event_handler::int_in_keymap |
int input map that is used for mapping spi keys to sdl scancodes
Definition at line 84 of file event_handler.cpp.
std::map<uint16_t, SDL_Scancode> event_handler::navigation_keymap |
Map for translating SPI keyboard scancodes keys to SDL scancodes for navigation.
Definition at line 58 of file event_handler.cpp.
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.
Definition at line 138 of file event_handler.cpp.