Olivier Smeesters / Mbed 2 deprecated DtmfKit

Dependencies:   mbed ExtTextLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers edit_state.cpp Source File

edit_state.cpp

00001 #include "system_states.hpp"
00002 #include "system.hpp"
00003 #include "display_manager.hpp"
00004 
00005 void EditState::enterState() {
00006     DisplayManager *display = system()->display();
00007     display->hideCursor();
00008     display->writeStatus("Edit: <*>Cmd");
00009     updateText();
00010 }
00011 
00012 void EditState::handleKey(char key)
00013 {
00014     if (key == '@') {
00015         system()->setState(System::Command);
00016     }
00017     else if (key == '$') {
00018         // ignored for the time being
00019     }
00020     else {
00021         handleSymbol(key);
00022     }
00023 }
00024 
00025 void EditState::handleSymbol(char ch) const {
00026     system()->insertSymbol(ch);
00027     updateText();
00028 }
00029