Your message dated Fri, 25 Sep 2009 16:34:53 +0000
with message-id <[email protected]>
and subject line Bug#524299: fixed in halevt 0.1.5-1
has caused the Debian Bug report #524299,
regarding Patch to add "detail" attribute for Condition rules, supports capture 
of hotkey events
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
524299: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524299
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package:  halevt
Version:  0.1.3-3
Severity: wishlist
Tags:     patch

Hi,

Attached is a relatively simple patch that adds support for an optional
"detail" attribute in Condition rules.  I would appreciate it if you would
consider adding this patch to the package and/or sending it upstream for
inclusion there.

As stated, this patch allows for multiple Condition rules on the same event
to be differentiated by a "detail" attribute, as repoted by "halevt -i".
This is useful, for example, to enable halevt to support event handlers for
hotkeys.

Hotkeys get processed by HAL via the input layer, either from the keyboard
driver (atkbd) or other machine-specific mechanisms (e.g., thinkpad-acpi).
Typically, HAL forwards these as keypress events to X11 where they're able
to be captured by client programs such as xbindkeys.

As far as I know, each hotkey generates a "ButtonPressed" event, which can
only be differentiated by the contents of the detail field, which contains
the name of the hotkey pressed.  Thus, this patch enables halevt to assign
event handlers for individual keypresses (as opposed to a single halder for
all hotkey events).

This patch is useful as there's no general way to capture hotkey events
outside X11.  The acpid package used to be capable of capturing some
hotkeys (those that went through the ACPI layer), but as of kernel 2.6.29
this ability has largely been lost due to the removal of the
/proc/acpi/events interface.  In contrast, this patch allows for all
hotkeys to be captured via halevt as a single general mechanism that works
in both the Linux console as well as X11.  Such a feature has already been
requested by others [1].

The patch includes an update to the example halevt.xml config file that
demonstrates how to use the detail attribute to write Condition rules that
capture keyboard volume buttons and execute commands that change system
volume accordingly.

Thanks!

[1] 
http://www.mail-archive.com/[email protected]/msg01705.html
diff -uNr halevt-0.1.3.orig/halevt.xml halevt-0.1.3/halevt.xml
--- halevt-0.1.3.orig/halevt.xml	2008-05-24 09:51:56.000000000 -0400
+++ halevt-0.1.3/halevt.xml	2009-04-15 23:22:13.412236485 -0400
@@ -83,6 +83,18 @@
 !-->
 
 <!-- 
+Example of a use of Condition with detail attribute. This condition
+differentiates between three different hotkeys for a ButtonPressed event
+and performs the appropriate action for each.
+
+<halevt:Device match="hal.input.originating_device.hal.info.linux.driver = atkbd">
+    <halevt:Condition name="ButtonPressed" detail="mute"        exec="amixer -q set Master toggle"/>
+    <halevt:Condition name="ButtonPressed" detail="volume-down" exec="amixer -q set Master 1-"/>
+    <halevt:Condition name="ButtonPressed" detail="volume-up"   exec="amixer -q set Master 1+"/>
+</halevt:Device>
+!-->
+
+<!-- 
 Example of a use of OnInit. At startup all the devices are matched and the exec
 comand is run for those that match.
 
diff -uNr halevt-0.1.3.orig/src/hal_interface.c halevt-0.1.3/src/hal_interface.c
--- halevt-0.1.3.orig/src/hal_interface.c	2008-06-05 19:12:00.000000000 -0400
+++ halevt-0.1.3/src/hal_interface.c	2009-04-15 23:22:13.412236485 -0400
@@ -204,6 +204,8 @@
     while (current_condition != NULL)
     {
         if (!strcmp(current_condition->name, condition_name)
+            &&  (current_condition->detail == NULL
+                 ||  !strcmp(current_condition->detail, condition_detail))
             &&  halevt_true_tree(current_condition->match, udi, NULL))
         {
             halevt_run_command(current_condition->exec, udi, NULL);
diff -uNr halevt-0.1.3.orig/src/parse_config.c halevt-0.1.3/src/parse_config.c
--- halevt-0.1.3.orig/src/parse_config.c	2007-02-04 21:23:36.000000000 -0500
+++ halevt-0.1.3/src/parse_config.c	2009-04-15 23:22:13.412236485 -0400
@@ -262,7 +262,7 @@
 }
 
 halevt_condition *halevt_add_condition(const xmlChar *match, 
-    const xmlChar *exec, const xmlChar *name)
+    const xmlChar *exec, const xmlChar *name, const xmlChar *detail)
 {
    halevt_condition *new_condition;
    new_condition = malloc (sizeof(halevt_condition));
@@ -279,15 +279,24 @@
          free(new_condition);
          return NULL;
       }
+      if (detail == NULL) { new_condition->detail = NULL; }
+      else if ((new_condition->detail = (char *) xmlStrdup(detail)) == NULL)
+      { 
+         halevt_free_boolean_expression (new_condition->match);
+         free(new_condition->name);
+         free(new_condition);
+         return NULL;
+      }
       if ((new_condition->exec = halevt_new_exec(exec)) == NULL)
       { 
          halevt_free_boolean_expression (new_condition->match);
          free(new_condition->name);
+         free(new_condition->detail);
          free(new_condition);
          return NULL;
       }
 /*
-      printf ("add_condition %s, %s, %s\n", match, exec, name);
+      printf ("add_condition %s, %s, %s, %s\n", match, exec, name, detail);
 */
       new_condition->next = halevt_condition_root;
       halevt_condition_root = new_condition;
@@ -453,15 +462,17 @@
                {
                   xmlChar *exec = NULL;
                   xmlChar *name = NULL;
+                  xmlChar *detail = NULL;
                   exec =  xmlGetProp(cur, (const xmlChar *) "exec");
                   name =  xmlGetProp(cur, (const xmlChar *) "name");
+                  detail =  xmlGetProp(cur, (const xmlChar *) "detail");
                   if (exec == NULL || name == NULL)
                   {
                      DEBUG(_("Warning: %s XML tag encountered with missing or bad attributes, ignored"), cur->name);
                   }
                   else
                   {
-                     halevt_add_condition(match, exec, name);
+                     halevt_add_condition(match, exec, name, detail);
                   }
                }
                else if (! xmlStrcmp(cur->name, (const xmlChar *) "Property"))
diff -uNr halevt-0.1.3.orig/src/parse_config.h halevt-0.1.3/src/parse_config.h
--- halevt-0.1.3.orig/src/parse_config.h	2007-02-04 19:50:41.000000000 -0500
+++ halevt-0.1.3/src/parse_config.h	2009-04-15 23:22:13.412236485 -0400
@@ -74,6 +74,7 @@
 typedef struct halevt_condition
 {
    char *name;
+   char *detail;
    halevt_exec *exec;
    halevt_boolean_expression *match;
    struct halevt_condition* next;

--- End Message ---
--- Begin Message ---
Source: halevt
Source-Version: 0.1.5-1

We believe that the bug you reported is fixed in the latest version of
halevt, which is due to be installed in the Debian FTP archive:

halevt_0.1.5-1.diff.gz
  to pool/main/h/halevt/halevt_0.1.5-1.diff.gz
halevt_0.1.5-1.dsc
  to pool/main/h/halevt/halevt_0.1.5-1.dsc
halevt_0.1.5-1_amd64.deb
  to pool/main/h/halevt/halevt_0.1.5-1_amd64.deb
halevt_0.1.5.orig.tar.gz
  to pool/main/h/halevt/halevt_0.1.5.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Mike O'Connor <[email protected]> (supplier of updated halevt package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 24 Sep 2009 02:07:26 -0400
Source: halevt
Binary: halevt
Architecture: source amd64
Version: 0.1.5-1
Distribution: unstable
Urgency: low
Maintainer: Mike O'Connor <[email protected]>
Changed-By: Mike O'Connor <[email protected]>
Description: 
 halevt     - Generic handler for HAL events
Closes: 524299 527960 528770 528773 532786 540620 540628 542710
Changes: 
 halevt (0.1.5-1) unstable; urgency=low
 .
   * New Upstream Version (Closes: #527960, #542710, #540628, #524299, #528773)
   * remove halevt-mount patch as it is included upstream
   * update init script patch as the bashisms were fixed upstream
   # add dependency on policykit and use policykit to grant/revoke privileges
     for mounting removable drives on install/remove. (Closes: #532786)
     (Thanks: Wolodja Wentland)
   * change update-rc.d to install halevt after hal (Closes: #528770)
     (Closes: #540620)
   * update to Standards-Version 3.8.2 (had to stop using /var/run/halevt/)
   * add halevt.xml to debian/ which was removed upstream
Checksums-Sha1: 
 3c4ada7463e7c43ce6b303cb9dacaefe5fd06aef 1104 halevt_0.1.5-1.dsc
 59c3d1e16153d8be5d65e9106e8e2c29b630f77b 348710 halevt_0.1.5.orig.tar.gz
 b1b1d3ff83e7ede38e6266a5b08356b58f8dc1f7 7783 halevt_0.1.5-1.diff.gz
 f3b13c5c81ef596657e44d0ef3d984b996fa0a3a 61124 halevt_0.1.5-1_amd64.deb
Checksums-Sha256: 
 0a4f102e3409664354de51c11cd1c4622632c7295f08ea0af4cfaddbb812c3a6 1104 
halevt_0.1.5-1.dsc
 1a438a621a91bf46ff629455ab98d4af62cb4ffcb6618ebcd8bdb8e7501d871f 348710 
halevt_0.1.5.orig.tar.gz
 6e8e542ff2f63dc077071626a636b33316fc86a83fab616d5d3f83153e7d88ad 7783 
halevt_0.1.5-1.diff.gz
 a8d3d87c5277607282396ddb5e82833e950d91f62a2ece24b78225678228fd1d 61124 
halevt_0.1.5-1_amd64.deb
Files: 
 13f55364d558503f9ac8739bc4b828b1 1104 admin optional halevt_0.1.5-1.dsc
 7faf2e2fdfe9535e64304c361e1fd0e7 348710 admin optional halevt_0.1.5.orig.tar.gz
 f8f1c2b3e3bdc8a2d8e44cfe455028a8 7783 admin optional halevt_0.1.5-1.diff.gz
 dcd06d5a9748bcc4fee8ccede183368b 61124 admin optional halevt_0.1.5-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkq813QACgkQ9Cbhsr6b+NqMxACfXPXGGWcftm34uO+3W+N6REBJ
CV8AoI9z7vbWAz2tGXCHTxc4/s+okq96
=ggOZ
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to