On Tue, 01 Sep 2015 07:16:19 +0000 Gaurav Kalra <gvka...@gmail.com> said:

> Hello List,
> 
> I am trying to monitor mouse events with a service application (no UI). My
> first try is committed here:
> https://github.com/gvkalra/gestures/blob/master/src/gestures.c

1. DONT DO THIS. ecore events for input are low level. don't touch them. you
don't get anything like rotation handling or even routing (eg you don't know
what window the event is for - what is the windows position on screen etc. etc.

2. you don't magically get ALL events. you only get events for the windows YOU
create OR select for input on. as such you do not create any windows so you'll
never get any input assuming everything else was done right. and selecting for
input on OTHER windows is a low level x11 operation in tizen 2. and tizen 3.x
on "it depends on display system" thus is unportable - so you can never do this
anyway. not going to help you there as you're already in
forbidden/unportable land.

3. it's not allowed. in fact with wayland for tizen 3+ you simply CANT go listen
to events on any window OTHER than your own you created. it's a security issue.
it's enforced by the compositor (display system). wayland fixes this. you will
NEVER be able to listen to mouse/touch event globally. EVER. don't ask to be
able to as the answer will be "no". allowing this can allow things like
listening to the input as a user types a password or pin number or any other
private info into ANOTHER app/window.

3. the reason it won't work is the event TYPE is invalid. the input layer has
not been ... inited - thus the event type has not been allocated thus its an
invalid event type thus it fails. as it should. :) given the above i'm not
going to tell you how to init it as you just will hit the next point of "it
doesn't work" until eventually the whole idea of this app fails.

so onto the topic of the idea. if it is a service app or a regular ui app, you
cannot listen to input events on some other window other than one YOU create
yourself. you want events? create a window - use actual objects to capture
events (eg a rectangle and set evas mouse down/move/up and/or multi
down/move/up for multitouch etc.).

> The problem that I am facing is in service_app_create().

and that is your other issue. it's a SERVICE... not ui. the point of a service
is to have nothing to do with ui. it's for headless back-end stuff. :)

> --8<---------------cut here---------------start------------->8---
> h_down = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, __mouse_down,
> NULL); h_up = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
> __mouse_up, NULL);
> --8<---------------cut here---------------end--------------->8---
> 
> h_down & h_up is always NULL even though there are no API and Privilege
> Violations.
> 
> Do I require some special permission to monitor mouse events with a service
> application?
> 
> Duplicate discussion: https://samsung.tizenforum.com/?topic=298.0
> I am posting on the list to reach wider audience.

sorry - i've been a bit busy of late to look through the forums. i REALLY wish
they'd sent mail so i can get a stream of "latest stuff" rather than have to
dig it out myself. :)

-- 
Carsten Haitzler (The Rasterman) <ti...@rasterman.com>
_______________________________________________
Application-dev mailing list
Application-dev@lists.tizen.org
https://lists.tizen.org/listinfo/application-dev

Reply via email to