- if(key==Msp::Input::KEY_ENTER)
- signal_accept.emit();
- else if(key==Msp::Input::KEY_ESC)
- signal_cancel.emit();
- else if(key==Msp::Input::KEY_BACKSPACE)
- {
- if(pos>0)
- {
- text.erase(pos-1, 1);
- --pos;
- }
- }
- else if(key==Msp::Input::KEY_DELETE)
- {
- if(pos<text.size())
- text.erase(pos, 1);
- }
- else if(key==Msp::Input::KEY_LEFT)
- {
- if(pos>0)
- --pos;
- }
- else if(key==Msp::Input::KEY_RIGHT)
- {
- if(pos<text.size())
- ++pos;
- }
- else if(ch>=0x20)
- {
- text.insert(pos, 1, ch);
- ++pos;
- }
-}