summaryrefslogtreecommitdiffstats
path: root/client_examples
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2018-07-30 19:47:26 +0200
committerChristian Beier <dontmind@freeshell.org>2018-07-30 19:47:32 +0200
commit474f64e5db23ccd14b2a281b4076be081297d110 (patch)
treeff9e3640eca3ccde8e5bf5d6674fdc3f9f8f2fff /client_examples
parent97c9b6c5d7959df3ea18c397a01db2b266ce204a (diff)
downloadlibtdevnc-474f64e5db23ccd14b2a281b4076be081297d110.tar.gz
libtdevnc-474f64e5db23ccd14b2a281b4076be081297d110.zip
SDLvncviewer: work around SDL_TEXTINPUT not generating chars with CTRL down
Diffstat (limited to 'client_examples')
-rw-r--r--client_examples/SDLvncviewer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/client_examples/SDLvncviewer.c b/client_examples/SDLvncviewer.c
index e2d4357..d17b74e 100644
--- a/client_examples/SDLvncviewer.c
+++ b/client_examples/SDLvncviewer.c
@@ -175,6 +175,10 @@ static rfbKeySym SDL_key2rfbKeySym(SDL_KeyboardEvent* e) {
case SDLK_SYSREQ: k = XK_Sys_Req; break;
default: break;
}
+ /* SDL_TEXTINPUT does not generate characters if ctrl is down, so handle those here */
+ if (k == 0 && sym > 0x0 && sym < 0x100 && e->keysym.mod & KMOD_CTRL)
+ k = sym;
+
return k;
}