On Mon, 5 Oct 2009 15:10:36 +0800 Brian Wang <brian.wang.0...@gmail.com> said:
> Hello all, > > I'm a newbie to EFL. Here it goes... > How do I create a window and handle key down/up events? > > Here is the snippet that I am using: > ... > win = elm_win_add(NULL, "hello", ELM_WIN_BASIC); > elm_win_title_set(win, "Hello"); > evas_object_smart_callback_add(win, "delete-request", win_del, NULL); > ... > Evas_Object *o; > > o = evas_object_rectangle_add(evas_object_evas_get(win)); > evas_object_color_set(o, 0, 0, 0, 0); > evas_object_resize(0, 320, 240); > > evas_object_event_callback_add(o, EVAS_CALLBACK_KEY_UP, > handle_key_up, NULL); evas_object_event_callback_add(o, > EVAS_CALLBACK_KEY_DOWN, handle_key_down, NULL); > evas_object_smart_member_add(o, win); > > ------------ > However, 'o' is not getting any key down/up events. > Could anyone tell me what is wrong with the code? well need to set the focus. evas_object_focus_set(o, 1); :) the focused object gets the key input for the canvas, there is only 1 focused object at a time. only specific keys grabbed by another object are sent to that object instead. > By the way, I'm using Elementary on our device and I am quite amazed > about how Elementary simplifies the programming effort. Kudoes E > developers! cool! nb - if you have the device public.. let us know. send some urls. if not - drop a line when it appears so we and drool. :) > Thanks in advance. > > > brian > > -- > brian > ------------------ > > Cool-Karaoke - The smallest recording studio, in your palm, open-sourced > http://cool-idea.com.tw/ > > iMaGiNaTiOn iS mOrE iMpOrTaNt tHaN kNoWlEdGe > > ------------------------------------------------------------------------------ > Come build with us! The BlackBerry® Developer Conference in SF, CA > is the only developer event you need to attend this year. Jumpstart your > developing skills, take BlackBerry mobile applications to market and stay > ahead of the curve. Join us from November 9-12, 2009. Register now! > http://p.sf.net/sfu/devconf > _______________________________________________ > enlightenment-devel mailing list > enlightenment-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) ras...@rasterman.com ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel