X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fdesigner%2Finput.cpp;h=d56cc1b0c5b42e9b11410612e8d3d3fc70396faf;hb=de09cba1d12af38ff2e7e4312d67624fe63bf0e4;hp=5c2e9210ff25cd9dcb3279c2b1a0d85579e1dfb9;hpb=540e931ec79129c8776f48434ff5b230b53337f1;p=r2c2.git diff --git a/source/designer/input.cpp b/source/designer/input.cpp index 5c2e921..d56cc1b 100644 --- a/source/designer/input.cpp +++ b/source/designer/input.cpp @@ -5,29 +5,29 @@ Copyright © 2006-2008 Mikkosoft Productions, Mikko Rasa Distributed under the GPL */ -#include #include #include +#include #include "designer.h" #include "input.h" using namespace std; using namespace Msp; -Input::Input(Designer &d, const string &t, const string &e): +::Input::Input(Designer &d, const string &t, const string &e): designer(d), title(t), text(e), pos(text.size()) { } -void Input::key_press(unsigned key, unsigned, wchar_t ch) +void ::Input::key_press(unsigned key, unsigned, wchar_t ch) { - if(key==SDLK_RETURN) + if(key==Msp::Input::KEY_ENTER) signal_accept.emit(); - else if(key==SDLK_ESCAPE) + else if(key==Msp::Input::KEY_ESC) signal_cancel.emit(); - else if(key==SDLK_BACKSPACE) + else if(key==Msp::Input::KEY_BACKSPACE) { if(pos>0) { @@ -35,17 +35,17 @@ void Input::key_press(unsigned key, unsigned, wchar_t ch) --pos; } } - else if(key==SDLK_DELETE) + else if(key==Msp::Input::KEY_DELETE) { if(pos0) --pos; } - else if(key==SDLK_RIGHT) + else if(key==Msp::Input::KEY_RIGHT) { if(pos