From 28200419f1f86843ef7d33285d83c32d57b31976 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 5 Jul 2012 14:51:29 +0000 Subject: [PATCH] fix 2 more things in ecore-fb SVN revision: 73361 --- legacy/ecore/ChangeLog | 3 ++- legacy/ecore/src/lib/ecore_fb/ecore_fb.c | 18 ++++++++++++++++++ legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c | 3 +++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index 967c5fdb9c..45162bafd8 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -811,4 +811,5 @@ pos/size as it should. * Fix ecore-fb to use key repeat like x so apps dont break in fb * Fix ecore-fb string lookup table to include ctrl+keys - + * Fix ecore-fb to trap sigint (ctrl+c) so it doesnt exit your fb app + * Fix ecore-fb mouse to swap button 2 and 3 ro work right. diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb.c index daeea0f8d9..5b2b84b1ab 100644 --- a/legacy/ecore/src/lib/ecore_fb/ecore_fb.c +++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb.c @@ -17,6 +17,13 @@ static int _ecore_fb_console_h = 0; * @{ */ +static sighandler_t oldhand = NULL; + +static void +nosigint(int val __UNUSED__) +{ +} + /** * @brief Initialize the Ecore_Fb library. * @@ -39,6 +46,11 @@ ecore_fb_init(const char *name __UNUSED__) if (!ecore_fb_vt_init()) return --_ecore_fb_init_count; + if (!oldhand) + { + oldhand = signal(SIGINT, nosigint); + } + _ecore_fb_size_get(&_ecore_fb_console_w, &_ecore_fb_console_h); return _ecore_fb_init_count; @@ -59,6 +71,12 @@ ecore_fb_shutdown(void) if (--_ecore_fb_init_count != 0) return _ecore_fb_init_count; + if (oldhand) + { + signal(SIGINT, oldhand); + oldhand = NULL; + } + ecore_fb_vt_shutdown(); return _ecore_fb_init_count; diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c index 3c37120231..23599c9ede 100644 --- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c +++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c @@ -148,6 +148,9 @@ _ecore_fb_li_device_event_key(Ecore_Fb_Input_Device *dev, struct input_event *ie double current = ecore_loop_time_get(); button = ((iev->code & 0x00F) + 1); + // swap 2 and 3 to make middle and right butotn work right. + if (button == 3) button = 2; + else if (button == 2) button = 3; if (iev->value) { dev->mouse.did_double = EINA_FALSE;