2015-01-06 3:59 GMT+01:00 Carsten Haitzler <[email protected]>: > On Tue, 6 Jan 2015 10:22:49 +0800 (CST) bray <[email protected]> said: > > > Hi, > > Thank you for your reply. > > how to grabbed the keyboard? > > as i said - no api to do that. it's not very sociable :) >
I agree with you that is not sociable and always discouraged, but I think the keyboard can be grabbed using the ecore_x api > > > BR > > bray > > > > > > > > At 2015-01-06 07:53:59, "Carsten Haitzler (The Rasterman)" > > <[email protected]> wrote: > > >On Mon, 5 Jan 2015 21:24:22 +0800 (CST) bray <[email protected]> said: > > > > > >> Hi everyone: > > >> > > >> I create a window by using EFL. > > >> then I create rectangle and listen to keyboard events. > > >> when this window hava focus, it can receive key events without > problem. > > >> > > >> But when this window in background or under another window. it can not > > >> receive anything. how can I receive key events in anytime? > > >> > > >> src: > > >> Evas_Object *bg = NULL; > > >> bg = evas_object_rectangle_add(evas); > > >> evas_object_event_callback_add(bg, EVAS_CALLBACK_KEY_DOWN, > TouchKeyDown, > > >> NULL); evas_object_focus_set(bg, EINA_TRUE); > > >> evas_object_color_set(bg, 255, 0, 0, 255); > > >> evas_object_move(bg, 0, 0); > > >> evas_object_resize(bg, width, height); > > >> evas_object_show(bg); > > > > > >you can't. in an x11 world key event only go to you if: > > > > > >1. your window is focused > > >or > > >2. you have grabbed the keyboard (if you grab, no other x client can > get key > > >events - not even the wm for its keybindings for changing desktops, > alt-tab > > >window switching, exiting/logging out etc.) - there isnt any elm api to > do a > > >keyboard grab (imho its pretty unsociable). > > > > > >(i'm ignoring the fact that there is the ability to use the xinput > extension > > >to passively monitor events on a device - also no api for this in elm, > and > > >this is precisely why x11 is insecure - any x client can effectively > listen > > >to any event anywhere - eg be a keylogger and log everything you type - > > >passwords included). > > > > > >-- > > >------------- Codito, ergo sum - "I code, therefore I am" -------------- > > >The Rasterman (Carsten Haitzler) [email protected] > > > > > > ------------------------------------------------------------------------------ > > Dive into the World of Parallel Programming! The Go Parallel Website, > > sponsored by Intel and developed in partnership with Slashdot Media, is > your > > hub for all things parallel software development, from weekly thought > > leadership blogs to news, videos, case studies, tutorials and more. Take > a > > look and join the conversation now. http://goparallel.sourceforge.net > > _______________________________________________ > > enlightenment-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/enlightenment-users > > > > > -- > ------------- Codito, ergo sum - "I code, therefore I am" -------------- > The Rasterman (Carsten Haitzler) [email protected] > > > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming! The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is > your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net > _______________________________________________ > enlightenment-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-users > ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ enlightenment-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-users
