aboutsummaryrefslogtreecommitdiff
path: root/nk_pugl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-20 22:03:43 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-20 22:03:43 +0100
commit5fe5c73b0cfb51bcb3934c0a6f9d06dfcc6c5e96 (patch)
tree7f1555b07c039e56a5576653a19917ef3a92907a /nk_pugl
parent18da5e18bd92eee1ab0fa4c6bedfb2e726669af0 (diff)
parentaff82e0eb1a0c26e1704a0fed36d8bf1657ee95d (diff)
downloadsynthpod-5fe5c73b0cfb51bcb3934c0a6f9d06dfcc6c5e96.tar.xz
Merge commit 'aff82e0eb1a0c26e1704a0fed36d8bf1657ee95d' into nk
Diffstat (limited to 'nk_pugl')
-rw-r--r--nk_pugl/nk_pugl.h110
1 files changed, 55 insertions, 55 deletions
diff --git a/nk_pugl/nk_pugl.h b/nk_pugl/nk_pugl.h
index cf05f3ee..0de714b6 100644
--- a/nk_pugl/nk_pugl.h
+++ b/nk_pugl/nk_pugl.h
@@ -499,65 +499,65 @@ _nk_pugl_other_key(struct nk_context *ctx, const PuglEventKey *ev, int down)
{
const bool control = ev->state & PUGL_MOD_CTRL;
- if(control)
+ switch(ev->character)
{
- const uint32_t character = ev->character + 96; //FIXME why +96?
- switch(character)
+ case '\r':
{
- case 'c':
- {
- nk_input_key(ctx, NK_KEY_COPY, down);
- } break;
- case 'v':
- {
- nk_input_key(ctx, NK_KEY_PASTE, down);
- } break;
- case 'x':
- {
- nk_input_key(ctx, NK_KEY_CUT, down);
- } break;
- case 'z':
- {
- nk_input_key(ctx, NK_KEY_TEXT_UNDO, down);
- } break;
- case 'r':
- {
- nk_input_key(ctx, NK_KEY_TEXT_REDO, down);
- } break;
+ nk_input_key(ctx, NK_KEY_ENTER, down);
+ } break;
+ case '\t':
+ {
+ nk_input_key(ctx, NK_KEY_TAB, down);
+ } break;
+ case PUGL_CHAR_DELETE:
+ {
+ nk_input_key(ctx, NK_KEY_DEL, down);
+ } break;
+ case PUGL_CHAR_BACKSPACE:
+ {
+ nk_input_key(ctx, NK_KEY_BACKSPACE, down);
+ } break;
+ case PUGL_CHAR_ESCAPE:
+ {
+ nk_input_key(ctx, NK_KEY_TEXT_RESET_MODE, down);
+ } break;
- default:
- {
- if(down && isalpha(character))
- nk_input_char(ctx, character);
- } break;
- }
- }
- else // !control
- {
- switch(ev->character)
+ default:
{
- case '\r':
- {
- nk_input_key(ctx, NK_KEY_ENTER, down);
- } break;
- case '\t':
- {
- nk_input_key(ctx, NK_KEY_TAB, down);
- } break;
- case PUGL_CHAR_DELETE:
- {
- nk_input_key(ctx, NK_KEY_DEL, down);
- } break;
- case PUGL_CHAR_BACKSPACE:
- {
- nk_input_key(ctx, NK_KEY_BACKSPACE, down);
- } break;
- case PUGL_CHAR_ESCAPE:
+ if(control)
{
- nk_input_key(ctx, NK_KEY_TEXT_RESET_MODE, down);
- } break;
+ const uint32_t character = ev->character + 96; //FIXME why +96?
+ switch(character)
+ {
+ case 'c':
+ {
+ nk_input_key(ctx, NK_KEY_COPY, down);
+ } break;
+ case 'v':
+ {
+ nk_input_key(ctx, NK_KEY_PASTE, down);
+ } break;
+ case 'x':
+ {
+ nk_input_key(ctx, NK_KEY_CUT, down);
+ } break;
+ case 'z':
+ {
+ nk_input_key(ctx, NK_KEY_TEXT_UNDO, down);
+ } break;
+ case 'r':
+ {
+ nk_input_key(ctx, NK_KEY_TEXT_REDO, down);
+ } break;
- default:
+ default:
+ {
+ if(down && isalpha(character))
+ nk_input_char(ctx, character);
+ } break;
+ }
+ }
+ else // !control
{
switch(ev->character)
{
@@ -573,8 +573,8 @@ _nk_pugl_other_key(struct nk_context *ctx, const PuglEventKey *ev, int down)
if(down)
nk_input_glyph(ctx, (const char *)ev->utf8);
- } break;
- }
+ }
+ } break;
}
}