[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#396622: multimedia keys are not working



Package: kmilo
Version: 4:3.5.5-1
Severity: normal

Hi,

I tried to get my multimedia keys (volume up/down, mute etc.) on my
laptop keyboard working. Unfortunately a standard kmilo installation had
not effect. I first had to map X keycodes (e.g keycode 160 =
XF86AudioMute)  via ~/.xmodmaprc and then I had to apply a patch [1] from
the kubuntu kdeutils package.
I don't know if the first issue can be resolved within kmilo/KDE but at
least consider to include the patch.

Cheers,
Michael

[1] Extracted from http://packages.ubuntu.com/edgy/utils/kmilo

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (300, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/dash
Kernel: Linux 2.6.19-rc4
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages kmilo depends on:
ii  kdelibs4c2a            4:3.5.5a.dfsg.1-2 core libraries and binaries for al
ii  libc6                  2.3.6.ds1-7       GNU C Library: Shared libraries
ii  libgcc1                1:4.1.1-19        GCC support library
ii  libice6                1:1.0.1-2         X11 Inter-Client Exchange library
ii  libpng12-0             1.2.8rel-7        PNG library - runtime
ii  libqt3-mt              3:3.3.7-1         Qt GUI Library (Threaded runtime v
ii  libsm6                 1:1.0.1-3         X11 Session Management library
ii  libstdc++6             4.1.1-19          The GNU Standard C++ Library v3
ii  libx11-6               2:1.0.3-2         X11 client-side library
ii  libxext6               1:1.0.1-2         X11 miscellaneous extension librar
ii  libxtst6               1:1.0.1-5         X11 Testing -- Resource extension 
ii  zlib1g                 1:1.2.3-13        compression library - runtime

kmilo recommends no packages.

-- no debconf information
diff -Nur kdeutils-3.5.4/kmilo/generic/generic_monitor.cpp kdeutils-3.5.4.new/kmilo/generic/generic_monitor.cpp
--- kdeutils-3.5.4/kmilo/generic/generic_monitor.cpp	2006-01-19 17:49:13.000000000 +0100
+++ kdeutils-3.5.4.new/kmilo/generic/generic_monitor.cpp	2006-08-20 12:14:10.000000000 +0200
@@ -25,6 +25,7 @@
 
 #include <kgenericfactory.h>
 #include <kdebug.h>
+#include <kprocess.h>
 
 #include <sys/types.h>
 #include <unistd.h>
@@ -33,6 +34,7 @@
 #include "kmilointerface.h"
 #include <qmessagebox.h>
 #include <qfile.h>
+#include <qdir.h>
 
 
 // FIXME: use DCOPRef where possible instead of hand-rolled DCOP calls.
@@ -58,7 +60,21 @@
 
 bool GenericMonitor::init()
 {
+	config = new KConfig("kmilodrc");
+	config->setGroup("kubuntu");
+
 	static const ShortcutInfo shortcuts[] = {
+		{ "Search", KShortcut("XF86Search"), SLOT(launchSearch()) },
+		{ "Home Folder", KShortcut("XF86MyComputer"), SLOT(launchHomeFolder()) },
+		{ "Mail", KShortcut("XF86Mail"), SLOT(launchMail()) },
+		{ "Audio Media", KShortcut("XF86AudioMedia"), SLOT(launchMusic()) },
+		{ "Music", KShortcut("XF86Music"), SLOT(launchMusic()) },
+		{ "Browser", KShortcut("XF86WWW"), SLOT(launchBrowser()) },
+		{ "Calculator", KShortcut("XF86Calculator"), SLOT(launchCalculator()) },
+		{ "Terminal", KShortcut("XF86Terminal"), SLOT(launchTerminal()) },
+		{ "Eject", KShortcut("XF86Eject"), SLOT(eject()) },
+		{ "Help", KShortcut("XF86Launch0"), SLOT(launchHelp()) },
+		{ "Light Bulb", KShortcut("XF86LightBulb"), SLOT(lightBulb()) },
 		{ "FastVolumeUp", Qt::Key_VolumeUp, SLOT(fastVolumeUp()) },
 		{ "FastVolumeDown", Qt::Key_VolumeDown, SLOT(fastVolumeDown()) },
 		{ "SlowVolumeUp", Qt::CTRL+Qt::Key_VolumeUp, SLOT(slowVolumeUp()) },
@@ -128,16 +144,16 @@
 
 void GenericMonitor::volumeUp(int step) 
 {	
-	if (!retrieveVolume())
-		return;
+ 	if (!retrieveVolume())
+ 		return;
 
-	// FIXME if the mixer doesn't support steps of the specified size it
-	// could get stuck at one position
-	m_volume += step;
-	if (m_volume > m_maxVolume)
-		m_volume = m_maxVolume;
+ 	// FIXME if the mixer doesn't support steps of the specified size it
+ 	// could get stuck at one position
+ 	m_volume += step;
+ 	if (m_volume > m_maxVolume)
+ 		m_volume = m_maxVolume;
 
-	displayVolume();
+ 	displayVolume();
 }
 
 void GenericMonitor::volumeDown(int step)
@@ -249,6 +265,68 @@
 	return m_displayType;
 }
 
+void GenericMonitor::launch(QString configKey, QString defaultApplication)
+{
+	QString application = config->readEntry(configKey, defaultApplication);
+	KProcess proc;
+	proc << application;
+	proc.start(KProcess::DontCare);
+}
+
+void GenericMonitor::launchMail()
+{
+	kdDebug() << "launchMail" << endl;
+    kapp->invokeMailer("", "", "", "", "", "", "", "");
+}
+
+void GenericMonitor::launchBrowser()
+{
+    kapp->invokeBrowser("");
+}
+
+void GenericMonitor::launchSearch()
+{
+    launch("search", "kfind");
+}
+
+void GenericMonitor::launchHomeFolder()
+{
+	QString home = QDir::home().path();
+	KProcess proc;
+	proc << "kfmclient" << "exec" << home;
+	proc.start(KProcess::DontCare);
+}
+
+void GenericMonitor::launchMusic()
+{
+    launch("search", "amarok");
+}
+
+void GenericMonitor::launchCalculator()
+{
+    launch("search", "speedcrunch");
+}
+
+void GenericMonitor::launchTerminal()
+{
+    launch("search", "konsole");
+}
+
+void GenericMonitor::launchHelp()
+{
+    launch("search", "khelpcenter");
+}
+
+void GenericMonitor::eject()
+{
+    launch("search", "eject");
+}
+
+void GenericMonitor::lightBulb()
+{
+	kdDebug() << "lightBulb()" << endl;
+		_interface->displayText("Screen Light");
+}
 
 K_EXPORT_COMPONENT_FACTORY(kmilo_generic, KGenericFactory<GenericMonitor>("kmilo_generic"))
 
diff -Nur kdeutils-3.5.4/kmilo/generic/generic_monitor.h kdeutils-3.5.4.new/kmilo/generic/generic_monitor.h
--- kdeutils-3.5.4/kmilo/generic/generic_monitor.h	2006-01-19 17:49:13.000000000 +0100
+++ kdeutils-3.5.4.new/kmilo/generic/generic_monitor.h	2006-08-20 12:13:23.000000000 +0200
@@ -29,6 +29,7 @@
 #include <kglobalaccel.h>
 #include <dcopref.h>
 #include <kapplication.h>
+#include <kconfig.h>
 
 #include "kmilod.h"
 #include "monitor.h"
@@ -62,6 +63,16 @@
   void fastVolumeUp();
   void fastVolumeDown();
   void mute();
+  void launchMail();
+  void launchBrowser();
+  void launchSearch();
+  void launchHomeFolder();
+  void launchMusic();
+  void launchCalculator();
+  void launchTerminal();
+  void launchHelp();
+  void eject();
+  void lightBulb();
 
 private:
   void volumeUp(int step);
@@ -69,8 +80,10 @@
 	bool retrieveMute();
 	bool retrieveVolume();
 	void displayVolume();
+  void launch(QString configKey, QString defaultApplication);
 
 	KGlobalAccel *ga;
+	KConfig* config;
 
 	DCOPRef *kmixClient, *kmixWindow;
 

Reply to: