On Tue, 6 Jan 2015 01:45:33 -0200 Martinx - ジェームズ <[email protected]> said:
> On 5 January 2015 at 21:53, Carsten Haitzler <[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). > > Hey Raster! > > I'm curious about something, it might be totally off-topic, but I need > to ask... Because I think you're the right person to ask this... > > When I'm using KVM Virtual Machines, under ANY Window Manager / DE > (E19, Unity, KDE, GNOME), when it grabs the keyboard+mouse, sometimes, it > becomes a huge mess! yes - correct. these emulators (qemu, vmware, etc.) do this in order to get the full keyboard with nothing taken away from them. they can be unsociable in doing this - correct. > I mean, it does not release the mouse, even after pressing "ctrl+alt" > (KVM's command release it) and then, I need to go to "ctrl+alt+F1" and > "kill kvm". > > This problem appear specially when KVM becomes too slow or freezes. > > Will that kind of "bad behavior" be changed when using E on top of Wayland?! well currently it will as wayland provides no mechanism to grab the mouse and/or keyboard like this. it would require an extension to wayland protocol to do this (last i looked). but even if we had such a protocol (and something simialr will eventually turn up due to needs), the compositor - that is e, still gets all the input (mouse and kbd etc.) and thus it could still use some emergency keybindings like ctrl+alt+x to close the window, or maybe some special keybinding to "break a grab". it could allow alt+tab to switch away and end the grab. it's up to e to decide what to do here and/or config > I mean, for example, when I'm using OSX (with XQuartz installed), and > I remotely connect into a KVM Hypervisor, using (from my OSX xterm > session) `ssh -X my-kvm-host` and `virt-manager`, then, even if a KVM > guest freezes with a grabbed keyboard+mouse, or just becomes very > slow, I can still forces it the release by pressing an OSX shortcut > like "command + tab", easy, easy, no need to kill KVM to get key+mouse > controls back... > > I'm wondering here, is XQuartz too much different from Xorg, that it > doesn't suffer from this problem that I'm seeing? Or, OSX never lost > its "keyboard + map" events, even if a KVM guest under XQuartz grabbed > it? xquartz is just an osx client - xorg on your desktop *IS* the entire display. there is no master parent display system managing it ala osx. > This is very annoying on Linux Desktop theses days and I'm wondering > if that will change with Wayland... If yes, then, I can't wait for > it!! :-D > > Thanks! > Thiago > > ------------------------------------------------------------------------------ > 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
