fix text input field rendering of hidden text

also: show hidden content of input field as long as CTRL is pressed
This commit is contained in:
ac-stef
2017-04-22 15:10:02 +02:00
parent 6af6f650d1
commit d73b0313cb
3 changed files with 19 additions and 23 deletions
+2 -7
View File
@@ -40,7 +40,7 @@ struct textinputbuffer
buf[0] = '\0';
}
bool key(int code, bool isdown, int unicode)
bool key(int code, bool isdown, int unicode) // returns true if buffer was modified
{
switch(code)
{
@@ -86,12 +86,7 @@ struct textinputbuffer
case SDLK_v:
extern void pasteconsole(char *dst);
#ifdef __APPLE__
#define MOD_KEYS (KMOD_LMETA|KMOD_RMETA)
#else
#define MOD_KEYS (KMOD_LCTRL|KMOD_RCTRL)
#endif
if(SDL_GetModState()&MOD_KEYS)
if(SDL_GetModState() & MOD_KEYS_CTRL)
{
pasteconsole(buf);
return true;