Author: olivier
Date: 2007-02-13 20:24:36 +0000 (Tue, 13 Feb 2007)
New Revision: 24969
Modified:
xfce-mcs-plugins/trunk/INSTALL
xfce-mcs-plugins/trunk/plugins/keyboard_plugin/default.xml
xfce-mcs-plugins/trunk/plugins/keyboard_plugin/keys_management.c
xfce-mcs-plugins/trunk/plugins/keyboard_plugin/shortcuts_plugin.c
Log:
Add support for keycode when no keysym is available (bug #2503), add default
shortcuts for volume control using aumix
Modified: xfce-mcs-plugins/trunk/INSTALL
===================================================================
--- xfce-mcs-plugins/trunk/INSTALL 2007-02-13 13:53:17 UTC (rev 24968)
+++ xfce-mcs-plugins/trunk/INSTALL 2007-02-13 20:24:36 UTC (rev 24969)
@@ -1,8 +1,8 @@
Installation Instructions
*************************
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
-Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
+2006 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
@@ -10,7 +10,10 @@
Basic Installation
==================
-These are generic installation instructions.
+Briefly, the shell commands `./configure; make; make install' should
+configure, build, and install this package. The following
+more-detailed instructions are generic; see the `README' file for
+instructions specific to this package.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -23,9 +26,9 @@
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. (Caching is
+the results of its tests to speed up reconfiguring. Caching is
disabled by default to prevent problems with accidental use of stale
-cache files.)
+cache files.
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
@@ -35,20 +38,17 @@
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
+`configure' by a program called `autoconf'. You need `configure.ac' if
+you want to change it or regenerate `configure' using a newer version
+of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
+ `./configure' to configure the package for your system.
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
+ Running `configure' might take a while. While running, it prints
+ some messages telling which features it is checking for.
2. Type `make' to compile the package.
@@ -78,7 +78,7 @@
by setting variables in the command line or in the environment. Here
is an example:
- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
*Note Defining Variables::, for more details.
@@ -87,31 +87,29 @@
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
+own directory. To do this, you can use GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory. After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
+ With a non-GNU `make', it is safer to compile the package for one
+architecture at a time in the source code directory. After you have
+installed the package for one architecture, use `make distclean' before
+reconfiguring for another architecture.
Installation Names
==================
-By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc. You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PREFIX'.
+By default, `make install' installs the package's commands under
+`/usr/local/bin', include files under `/usr/local/include', etc. You
+can specify an installation prefix other than `/usr/local' by giving
+`configure' the option `--prefix=PREFIX'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
-give `configure' the option `--exec-prefix=PREFIX', the package will
-use PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
+pass the option `--exec-prefix=PREFIX' to `configure', the package uses
+PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular
@@ -159,7 +157,7 @@
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
+use the option `--target=TYPE' to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
@@ -189,9 +187,14 @@
./configure CC=/usr/local2/bin/gcc
-will cause the specified gcc to be used as the C compiler (unless it is
+causes the specified `gcc' to be used as the C compiler (unless it is
overridden in the site shell script).
+Unfortunately, this technique does not work for `CONFIG_SHELL' due to
+an Autoconf bug. Until the bug is fixed you can use this workaround:
+
+ CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+
`configure' Invocation
======================
Modified: xfce-mcs-plugins/trunk/plugins/keyboard_plugin/default.xml
===================================================================
--- xfce-mcs-plugins/trunk/plugins/keyboard_plugin/default.xml 2007-02-13
13:53:17 UTC (rev 24968)
+++ xfce-mcs-plugins/trunk/plugins/keyboard_plugin/default.xml 2007-02-13
20:24:36 UTC (rev 24969)
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<shortcuts-theme name="Default">
+ <shortcut command="aumix -v+10" keys="XF86AudioRaiseVolume"/>
+ <shortcut command="aumix -v-10" keys="XF86AudioLowerVolume"/>
+ <shortcut command="aumix -v0" keys="XF86AudioMute"/>
<shortcut command="xfhelp4" keys="Alt+F1"/>
<shortcut command="xflock4" keys="Control+Alt+Delete"/>
<shortcut command="xfrun4" keys="Alt+F2"/>
Modified: xfce-mcs-plugins/trunk/plugins/keyboard_plugin/keys_management.c
===================================================================
--- xfce-mcs-plugins/trunk/plugins/keyboard_plugin/keys_management.c
2007-02-13 13:53:17 UTC (rev 24968)
+++ xfce-mcs-plugins/trunk/plugins/keyboard_plugin/keys_management.c
2007-02-13 20:24:36 UTC (rev 24969)
@@ -44,6 +44,29 @@
unsigned int SuperMask = 0;
unsigned int HyperMask = 0;
+static gboolean
+get_keycode (Display *dpy, const char *str, KeyCode *keycode)
+{
+ unsigned int value;
+ KeySym keysym;
+
+ keysym = XStringToKeysym (str);
+ if (keysym == NoSymbol)
+ {
+ if (sscanf (str, "0x%X", (unsigned int *) &value) != 1)
+ {
+ *keycode = 0;
+ return FALSE;
+ }
+ *keycode = (KeyCode) value;
+ }
+ else
+ {
+ *keycode = XKeysymToKeycode (dpy, keysym);
+ }
+ return TRUE;
+}
+
MyKey *
parseKeyString (char *str)
{
@@ -67,7 +90,7 @@
tmp = g_ascii_strdown ((gchar *) str, strlen (str));
- my_key->keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdisplay),
XStringToKeysym (++k));
+ get_keycode (GDK_DISPLAY_XDISPLAY (gdisplay), ++k, &my_key->keycode);
if (strstr (tmp, "shift"))
{
my_key->modifier = my_key->modifier | ShiftMask;
@@ -116,7 +139,7 @@
}
else
{
- my_key->keycode = XKeysymToKeycode (GDK_DISPLAY_XDISPLAY (gdisplay),
XStringToKeysym (str));
+ get_keycode (GDK_DISPLAY_XDISPLAY (gdisplay), str, &my_key->keycode);
my_key->modifier = 0;
}
Modified: xfce-mcs-plugins/trunk/plugins/keyboard_plugin/shortcuts_plugin.c
===================================================================
--- xfce-mcs-plugins/trunk/plugins/keyboard_plugin/shortcuts_plugin.c
2007-02-13 13:53:17 UTC (rev 24968)
+++ xfce-mcs-plugins/trunk/plugins/keyboard_plugin/shortcuts_plugin.c
2007-02-13 20:24:36 UTC (rev 24969)
@@ -1002,6 +1002,12 @@
shortcut_string[strlen (shortcut_string) - 1] = '\0'; /* replace the
trailing '+' */
g_free (accelerator);
g_strfreev (shortcuts);
+
+ /* Use keycode if unknown keysym */
+ if (!strlen (shortcut_string))
+ {
+ g_snprintf (shortcut_string, sizeof (shortcut_string), "0x%X", (guint)
event->hardware_keycode);
+ }
/* check if shorcut already exists */
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW
(dialog->treeview_shortcuts));
_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits