aboutsummaryrefslogtreecommitdiff
path: root/subprojects/nk_pugl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-04-09 10:45:04 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-04-09 10:45:04 +0200
commitdfa52f063109020d1d6c10a3345699337442ec8a (patch)
treed83f2a3628190e187eefe349ace80e7977dab1c9 /subprojects/nk_pugl
parent64e6ff5d90fcd7851947e66ba3d70e9aed9b880e (diff)
parent76751004071055859a51932bf4b4e3a118379a0d (diff)
downloadsherlock.lv2-dfa52f063109020d1d6c10a3345699337442ec8a.tar.xz
Merge commit '76751004071055859a51932bf4b4e3a118379a0d'
Diffstat (limited to 'subprojects/nk_pugl')
-rw-r--r--subprojects/nk_pugl/VERSION2
-rw-r--r--subprojects/nk_pugl/nk_pugl/nk_pugl.h15
2 files changed, 10 insertions, 7 deletions
diff --git a/subprojects/nk_pugl/VERSION b/subprojects/nk_pugl/VERSION
index 66c0104..56ebc9e 100644
--- a/subprojects/nk_pugl/VERSION
+++ b/subprojects/nk_pugl/VERSION
@@ -1 +1 @@
-0.1.131
+0.1.133
diff --git a/subprojects/nk_pugl/nk_pugl/nk_pugl.h b/subprojects/nk_pugl/nk_pugl/nk_pugl.h
index 52e0ee0..7f543ba 100644
--- a/subprojects/nk_pugl/nk_pugl/nk_pugl.h
+++ b/subprojects/nk_pugl/nk_pugl/nk_pugl.h
@@ -915,10 +915,14 @@ _nk_pugl_event_func(PuglView *view, const PuglEvent *e)
{
const PuglEventText *ev = (const PuglEventText *)e;
- if(isprint(ev->character))
+ const bool control = ev->state & PUGL_MOD_CTRL;
+
+ const int ch = control ? ev->character | 0x60 : ev->character;
+
+ if(isprint(ch))
{
_nk_pugl_key_press(ctx, NK_KEY_TEXT_INSERT_MODE);
- nk_input_unicode(ctx, ev->character);
+ nk_input_unicode(ctx, ch);
}
} break;
@@ -1368,13 +1372,12 @@ nk_pugl_is_shortcut_pressed(struct nk_input *in, char letter, bool clear)
if(control && (in->keyboard.text_len == 1) )
{
- // unescape ASCII control chars + Control
- const char ch = in->keyboard.text[0] | 0x60;
-
- if(isalpha(ch) && (ch == letter) ) // pass non-alpha characters through
+ if(in->keyboard.text[0] == letter)
{
if(clear)
+ {
in->keyboard.text_len = 0;
+ }
return true; // matching shortcut
}