|
2012-10-20
, 18:31
|
Posts: 986 |
Thanked: 1,526 times |
Joined on Jul 2010
|
#162
|
i vote for both
The silent mode is a small price for the ease of access...
|
2012-10-20
, 18:45
|
|
Posts: 426 |
Thanked: 374 times |
Joined on Apr 2012
@ Middle East
|
#163
|
|
2012-10-20
, 18:49
|
|
Moderator |
Posts: 3,718 |
Thanked: 7,419 times |
Joined on Dec 2009
@ Bize Her Yer Trabzon
|
#164
|
lolololollololololololololololololol win98
htheb, youre aware of the two obstacles right?
1) we have to cancel ALL default actions in ALL apps. i dont know if this is possible without touching the apps themselves, which are mostly closed. {this needs to still let n9-button-monitor receive the events; disabling the buttons completely wont solve it, of course}
2) {and i HALF solved this one} we have to be able to programmatically control the volume. i can only do this with a mafw application running in the background, which i may be able to do as a daemon
solicit someone who has some experience with the mostly-closed-source guts of harmattan to do #1 for us, and i will deliver you your application. i personally cant fathom how to accomplish #1, and i spent awhile banging my head.
|
2012-10-21
, 05:54
|
Posts: 986 |
Thanked: 1,526 times |
Joined on Jul 2010
|
#165
|
The Following User Says Thank You to wolke For This Useful Post: | ||
|
2012-11-07
, 16:25
|
Posts: 986 |
Thanked: 1,526 times |
Joined on Jul 2010
|
#166
|
The Following 5 Users Say Thank You to wolke For This Useful Post: | ||
|
2012-11-07
, 18:44
|
Moderator |
Posts: 6,215 |
Thanked: 6,400 times |
Joined on Nov 2011
|
#167
|
|
2013-01-06
, 18:30
|
Posts: 986 |
Thanked: 1,526 times |
Joined on Jul 2010
|
#169
|
The Following User Says Thank You to wolke For This Useful Post: | ||
|
2013-01-06
, 18:34
|
Posts: 986 |
Thanked: 1,526 times |
Joined on Jul 2010
|
#170
|
user:~$ python /home/user/MyDocs/dbusbtn.py button: previous-song ignored: previous-song ignored: previous-song ignored: previous-song ignored: previous-song ignored: previous-song ignored: previous-song ignored: previous-song button: next-song button: play-cd button: stop-cd
#!/usr/bin/python #N9 Button Monitor #Copyright 2012 Elliot Wolk # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. import sys import time import signal from traceback import print_exc import dbus from dbus.mainloop.glib import DBusGMainLoop from PySide.QtCore import QCoreApplication signal.signal(signal.SIGINT, signal.SIG_DFL) dbus_service="org.freedesktop.Hal" dbus_path="/org/freedesktop/Hal/devices/computer_logicaldev_input_0" dbus_interface="org.freedesktop.Hal.Device" dbus_member="Condition" ## for some horrible reason, i get 8 clicks sometimes ## this buffer ignores repeated clicks within a certain time ## set it to -1 to never ignore repeat_buffer_millis=800 last_button_click_millis = dict() def button_clicked(button, handler): now_millis = int(round(time.time() * 1000)) if button in last_button_click_millis: then_millis = last_button_click_millis[button] if now_millis - then_millis < repeat_buffer_millis: print >> sys.stderr, " ignored: " + button return last_button_click_millis[button] = now_millis handler(button) def defaultHandler(button): print >> sys.stderr, "button: " + button def connectButtonDbus(handler=defaultHandler): dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) bus = dbus.SystemBus() try: obj = bus.get_object(dbus_service, dbus_path) iface = dbus.Interface(obj, dbus_interface) except dbus.DBusException: print_exc() sys.exit(1) iface.connect_to_signal(dbus_member, lambda cond, arg: button_clicked(arg, handler)) if __name__ == '__main__': app = QCoreApplication([]) connectButtonDbus() app.exec_()
The Following User Says Thank You to wolke For This Useful Post: | ||
The silent mode is a small price for the ease of access...