From 626ecbfca04e95bcb42390827112b2d7de1c903f Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Wed, 7 Mar 2018 23:01:50 +0000 Subject: Android: specific event for Android. Use Fl::add_system_handler() and Fl::event(), for example: FL_ANDROID_EVENT_LOW_MEMORY git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12720 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/Android/Fl_Android_Screen_Driver.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/drivers/Android/Fl_Android_Screen_Driver.cxx b/src/drivers/Android/Fl_Android_Screen_Driver.cxx index 9156d8c83..be2c94248 100644 --- a/src/drivers/Android/Fl_Android_Screen_Driver.cxx +++ b/src/drivers/Android/Fl_Android_Screen_Driver.cxx @@ -59,11 +59,22 @@ Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver() return new Fl_Android_Screen_Driver(); } + +extern int fl_send_system_handlers(void *e); + int Fl_Android_Screen_Driver::handle_app_command() { + // get the command int8_t cmd = Fl_Android_Application::read_cmd(); + + // setup the Android glue and prepare all settings for calling into FLTK Fl_Android_Application::pre_exec_cmd(cmd); - // TODO: call Fl::handle() with event parametrs set + + // call all registered FLTK system handlers + Fl::e_number = ((uint32_t)cmd-APP_CMD_INPUT_CHANGED) + FL_ANDROID_EVENT_INPUT_CHANGED; + fl_send_system_handlers(0L); + + // fixup and finalize application wide command handling Fl_Android_Application::post_exec_cmd(cmd); return 1; } -- cgit v1.2.3