Add Key and Mouse event for tizen port.
These event is based by ecore-input.
This patch is made by Eunyu Eun
Change-Id: I89a5dcf77b4819a9a8dbe52c23f464d4dbcf1c18
if test x$PKG_CONFIG != xno && \
test x$video_opengl_egl = xyes && \
test x$video_opengles_v2 = xyes; then
- if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl dlog; then
- TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl dlog`
- TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl dlog`
+ if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl ecore-input dlog; then
+ TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl ecore-input dlog`
+ TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl ecore-input dlog`
video_tizen=yes
fi
fi
if test x$PKG_CONFIG != xno && \
test x$video_opengl_egl = xyes && \
test x$video_opengles_v2 = xyes; then
- if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl dlog; then
- TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl dlog`
- TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl dlog`
+ if $PKG_CONFIG --exists wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl ecore-input dlog; then
+ TIZEN_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl ecore-input dlog`
+ TIZEN_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl ecore ecore-wayland evas eina appcore-efl ecore-input dlog`
video_tizen=yes
fi
fi
ecore_main_loop_iterate();
}
+Eina_Bool
+__tizen_cb_event_keyup_change(void *data, int type, void *event)
+{
+ printf("SAMPLE EV :key up\n");
+
+ if (!event) return ECORE_CALLBACK_PASS_ON;
+
+ Ecore_Event_Key * e = event;
+ SDL_SendKeyboardKey(SDL_RELEASED, e->keycode);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+Eina_Bool
+__tizen_cb_event_keydown_change(void *data, int type, void *event)
+{
+ printf("SAMPLE EV :key down\n");
+
+ if (!event) return ECORE_CALLBACK_PASS_ON;
+
+ Ecore_Event_Key * e = event;
+ SDL_SendKeyboardKey(SDL_PRESSED, e->keycode);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
#endif /* SDL_VIDEO_DRIVER_TIZEN */
/* vi: set ts=4 sw=4 expandtab: */
extern void Tizen_PumpEvents(_THIS);
+
+extern Eina_Bool __tizen_cb_event_keyup_change(void *data, int type, void *event);
+
+extern Eina_Bool __tizen_cb_event_keydown_change(void *data, int type, void *event);
+
+
#endif /* _SDL_tizenevents_h */
/* vi: set ts=4 sw=4 expandtab: */
*/
#include "../../SDL_internal.h"
+#include "SDL_tizenmouse.h"
+
+
+Eina_Bool
+__tizen_cb_event_mousedown_change(void *data, int type, void *event)
+{
+ SDL_VideoDevice *_this = SDL_GetVideoDevice();
+
+ printf("SAMPLE EV :mouse down\n");
+ if (!event) return ECORE_CALLBACK_PASS_ON;
+
+ Ecore_Event_Mouse_Button *e = event;
+ SDL_SendMouseMotion(_this->current_glwin, 0, 0, e->x, e->y);
+ SDL_SendMouseButton(_this->current_glwin, 0, SDL_PRESSED, SDL_BUTTON_LEFT);
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+Eina_Bool
+__tizen_cb_event_mouseup_change(void *data, int type, void *event)
+{
+ SDL_VideoDevice *_this = SDL_GetVideoDevice();
+ printf("TIZEN EV :mouse up\n");
+ if (!event) return ECORE_CALLBACK_PASS_ON;
+
+ Ecore_Event_Mouse_Button *e = event;
+ SDL_SendMouseMotion(_this->current_glwin, 0, 0, e->x, e->y);
+ SDL_SendMouseButton(_this->current_glwin, 0, SDL_RELEASED, SDL_BUTTON_LEFT);
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+Eina_Bool
+__tizen_cb_event_mousemove_change(void *data, int type, void *event)
+{
+ SDL_VideoDevice *_this = SDL_GetVideoDevice();
+ printf("TIZEN : mousemove\n");
+
+ if (!event) return ECORE_CALLBACK_PASS_ON;
+
+ Ecore_Event_Mouse_Move *e = event;
+ SDL_SendMouseMotion(_this->current_glwin, 0, 0, e->x, e->y);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+
+
#include "../../SDL_internal.h"
#include "SDL_mouse.h"
#include "SDL_tizenvideo.h"
+#include "SDL_tizenwindow.h"
+#include "SDL_events.h"
+
+extern Eina_Bool __tizen_cb_event_mouseup_change(void *data, int type, void *event);
+extern Eina_Bool __tizen_cb_event_mousedown_change(void *data, int type, void *event);
+extern Eina_Bool __tizen_cb_event_mousemove_change(void *data, int type, void *event);
+
#include "SDL_tizenvideo.h"
#include "SDL_tizentouch.h"
+#include "SDL_tizenmouse.h"
+#include "SDL_tizenevents_c.h"
+
#include <wayland-egl.h>
SDL_bool
ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_VISIBILITY_CHANGE,
__tizen_cb_window_visibility_change, _this);
+ ecore_event_handler_add(ECORE_EVENT_KEY_UP,
+ __tizen_cb_event_keyup_change, NULL);
+ ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
+ __tizen_cb_event_keydown_change, NULL);
+
+ ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
+ __tizen_cb_event_mousedown_change, _this);
+ ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
+ __tizen_cb_event_mouseup_change, _this);
+ ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
+ __tizen_cb_event_mousemove_change, _this);
return 0;
}
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
+#include <Ecore_Input.h>
#include "../../SDL_internal.h"