From adc3b2b059d4bd59f813f37219beaf8d7bd43d64 Mon Sep 17 00:00:00 2001 From: Daniel Collin Date: Tue, 23 Oct 2012 10:36:02 +0200 Subject: [PATCH] Current status --- ogl_editor/src/Editor.c | 9 ++++++++- ogl_editor/src/Editor.h | 2 +- ogl_editor/src/macosx/RocketView.m | 6 +++--- test.rocket | 9 +++++++++ 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100755 test.rocket diff --git a/ogl_editor/src/Editor.c b/ogl_editor/src/Editor.c index 45b02c8..6cf29c9 100644 --- a/ogl_editor/src/Editor.c +++ b/ogl_editor/src/Editor.c @@ -216,14 +216,17 @@ void Editor_update() /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void Editor_keyDown(int key) +bool Editor_keyDown(int key) { + bool handled_key = true; + //printf("callBack %d\n", key); switch (key) { case EMGUI_ARROW_DOWN : start_pos++; break; case EMGUI_ARROW_UP : start_pos--; break; + default : handled_key = false; break; } if (start_pos < -19) @@ -238,7 +241,11 @@ void Editor_keyDown(int key) if (offset > s_testChannel.maxRange) s_testChannel.maxRange = offset; + + return true; } + + return handled_key; } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/ogl_editor/src/Editor.h b/ogl_editor/src/Editor.h index 80c572b..843758c 100644 --- a/ogl_editor/src/Editor.h +++ b/ogl_editor/src/Editor.h @@ -4,5 +4,5 @@ void Editor_create(); void Editor_destroy(); void Editor_init(); void Editor_update(); -void Editor_keyDown(int keyCode); +bool Editor_keyDown(int keyCode); diff --git a/ogl_editor/src/macosx/RocketView.m b/ogl_editor/src/macosx/RocketView.m index 21ef17d..540d8c7 100644 --- a/ogl_editor/src/macosx/RocketView.m +++ b/ogl_editor/src/macosx/RocketView.m @@ -70,10 +70,10 @@ } } - Editor_keyDown(keyCode); - Editor_update(); + if (!Editor_keyDown(keyCode)) + [super keyDown:theEvent]; - //[super keyDown:theEvent]; + Editor_update(); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/test.rocket b/test.rocket new file mode 100755 index 0000000..be7b80a --- /dev/null +++ b/test.rocket @@ -0,0 +1,9 @@ + + + + + + + + +