Active Topics

 


Reply
Thread Tools
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#1
In my quest to enable a real right click (not that press and hold bollocks that is made of constant fail) I have arrived at the conclusion that the optimal way to do this would be to use the rather annoying proximity sensor.

My idea, to enable right click by pressing the proximity sensor.

How to achieve this? As far as I can tell the way to do this is with proximityd, a dbus script and xmodmap.

That is you turn on right click support (either a button or ties to the launch of particular programs) this enables P.sensor polling by proximityd which in turn reports the condition of the sensor to dbus. dbus scripts then reacts to sensor covered to swap left and right mouse buttons, switch back when sensor uncovered.

While this seems strait forward in words I am struggling to see how to monitor for the proximity switch condition change on the dbus.

proximityd

dbus scripts

Any thoughts on how to do this?
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.

Last edited by vi_; 2011-02-25 at 12:55.
 

The Following 2 Users Say Thank You to vi_ For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#2
Nobody?

Cool, lets all jerk off about how microsoft have *** jacked our beloved nokia some more.

Here we have the 'string' from dbus-scripts to match all wlan events:
Code:
/some/script * * com.nokia.icd status_changed * WLAN_INFRA
How do I write a similar string to match proximity sensor events ala this:

Code:
/some/script * * com.nokia.icd status_changed <some network> WLAN_INFRA CONNECTED
com.nokia.icd <-- i.e. what comes in place of this bit?
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following User Says Thank You to vi_ For This Useful Post:
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#3
Originally Posted by vi_ View Post
Nobody?

Cool, lets all jerk off about how microsoft have *** jacked our beloved nokia some more.

Here we have the 'string' from dbus-scripts to match all wlan events:
Code:
/some/script * * com.nokia.icd status_changed * WLAN_INFRA
How do I write a similar string to match proximity sensor events ala this:

Code:
/some/script * * com.nokia.icd status_changed <some network> WLAN_INFRA CONNECTED
com.nokia.icd <-- i.e. what comes in place of this bit?
I have absolutely no idea but I think you're not getting an answer because most people seeing this don't know. You may have more luck contacting the creator of shortcutd perhaps or looking at its code.

Last edited by Cue; 2011-02-25 at 09:09.
 
Posts: 219 | Thanked: 94 times | Joined on Nov 2009 @ Helsinki, Finland
#4
Use e.g. the command line tool called dbus-monitor. There might be even better options, but I don't recall currently.
__________________
Ham > Turkey
 
Posts: 38 | Thanked: 33 times | Joined on Aug 2010 @ Bangalore, India
#5
Not sure if this will help you, but dug up this old post:

http://talk.maemo.org/showpost.php?p=368865&postcount=2

I checked it using cat and is working.

But polling on a file value may not be a good idea huh? Something that can be done based on this?

BTW, love your idea of right click using proximity sensor!
 

The Following 2 Users Say Thank You to kitwalker For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#6
just done that, used:

dbus-monitor "type='signal'

To see the 'open' and close' signals. I am getting closer however I cannot quite see how to piece this together yet.

I emailed hopbeat asking if he would consider incorporating such functionality into shortcutd however he simply ignored me.

I am surprised nobody has addressed this right click issue before. I mean battle for wesnoth, comix, every friggin text field there is has a r/click context menu that we cannot use!
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 

The Following 2 Users Say Thank You to vi_ For This Useful Post:
Posts: 840 | Thanked: 823 times | Joined on Nov 2009
#7
Originally Posted by vi_ View Post
just done that, used:

dbus-monitor "type='signal'

To see the 'open' and close' signals. I am getting closer however I cannot quite see how to piece this together yet.

I emailed hopbeat asking if he would consider incorporating such functionality into shortcutd however he simply ignored me.

I am surprised nobody has addressed this right click issue before. I mean battle for wesnoth, comix, every friggin text field there is has a r/click context menu that we cannot use!
I'm a little confused by the problem. Do the signals not show when you cover the proximity sensor? What exactly are you having trouble with?
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#8
My problem is this is my first forray into dbus scripts and I am unfamilliar with the nomenclature. The documentation says:

Code:
 # First argument is sender
 # Second argument is destination
 # For SIGNAL and METHOD_CALL, third argument is interface
 # For SIGNAL and METHOD_CALL, fourth argument is member
 # Other arguments depend on the message

/some/script/here * * <proximityd interface> <member> <somthing else>

What is the interface name of proximityd?
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#9
Ahaah hahaha ha ha!!

the --debug flag is essential for looking at what's going on if you plan to write your own scripts. Run "dbus-scripts --debug" in a terminal and then perform whatever actions on the phone, to see all the events you can process using dbus-scripts. To see events on the session bus, make that "dbus-scripts --debug --session".

Code:
/sys/devices/platform/gpio-switch/proximity/state
Thanks, was looking for that!
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.

Last edited by vi_; 2011-02-25 at 09:50.
 

The Following 2 Users Say Thank You to vi_ For This Useful Post:
Posts: 1,680 | Thanked: 3,685 times | Joined on Jan 2011
#10
After some thought it has occoured to me...perhaps I am barking up the wrong bush?

My proposed method involves switching proximity sensor polling on and off in order to run a script at the appropriate time to action a mouse button change. (obviously stopping polling when the system goes to sleep to stop it from not going to sleep).

As kitwalker pointed out above qwerty12(R.I.P.) there is already a /sys/ file that reacts to the proximity sensor (probably using a hardware interrupt).

The logical way is to use the /sys/ entry but in a way that does not use polling from a script (polling=bad).

What about inotify? Do you think it is possible to use a call like:

Code:
 #!/bin/sh
       while inotifywait -e modify /sys/path/to/proximitysensor; do
         if sensor open; then
           xmodmap set right click
         else
           xmodmap sel left click
         fi
       done
?

(I am at work so will have to wait till later to test this!)
__________________
N900: One of God's own prototypes. A high-powered mutant of some kind never even considered for mass production. Too weird to live, and too rare to die.
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:00.