Author: tom
Date: Wed Oct  8 08:11:42 2008
New Revision: 3083

URL: http://svn.slimdevices.com?rev=3083&root=Jive&view=rev
Log:
Added support to SDL for Linux multimedia keys. Based (with small 
modifications) from: 
http://lists.libsdl.org/htdig.cgi/sdl-libsdl.org/2003-January/033209.html

Modified:
    7.3/trunk/squeezeplay/src/SDL-1.2.13/configure
    7.3/trunk/squeezeplay/src/SDL-1.2.13/configure.in
    7.3/trunk/squeezeplay/src/SDL-1.2.13/include/SDL_keysym.h
    7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/x11/SDL_x11events.c

Modified: 7.3/trunk/squeezeplay/src/SDL-1.2.13/configure
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/SDL-1.2.13/configure?rev=3083&root=Jive&r1=3082&r2=3083&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/SDL-1.2.13/configure (original)
+++ 7.3/trunk/squeezeplay/src/SDL-1.2.13/configure Wed Oct  8 08:11:42 2008
@@ -1546,6 +1546,7 @@
                           enable X11 Xrandr extension for fullscreen
                           [default=yes]
   --enable-video-x11-dpms enable X11 DPMS extension [default=yes]
+  --enable-video-x11-xf86-keysyms   use XFree86's Internet-Keyboard 
keysymsdefault=yes
   --enable-video-photon   use QNX Photon video driver [default=yes]
   --enable-video-carbon   use Carbon/QuickDraw video driver [default=no]
   --enable-video-cocoa    use Cocoa/Quartz video driver [default=yes]
@@ -4589,7 +4590,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 4592 "configure"' > conftest.$ac_ext
+  echo '#line 4593 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -7033,11 +7034,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7036: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7037: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7040: \$? = $ac_status" >&5
+   echo "$as_me:7041: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7301,11 +7302,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7304: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7305: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7308: \$? = $ac_status" >&5
+   echo "$as_me:7309: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -7405,11 +7406,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7408: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7409: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:7412: \$? = $ac_status" >&5
+   echo "$as_me:7413: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -9715,7 +9716,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9718 "configure"
+#line 9719 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -9815,7 +9816,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 9818 "configure"
+#line 9819 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12155,11 +12156,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12158: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12159: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:12162: \$? = $ac_status" >&5
+   echo "$as_me:12163: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -12259,11 +12260,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12262: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12263: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12266: \$? = $ac_status" >&5
+   echo "$as_me:12267: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -13831,11 +13832,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13834: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13835: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:13838: \$? = $ac_status" >&5
+   echo "$as_me:13839: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -13935,11 +13936,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:13938: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:13939: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:13942: \$? = $ac_status" >&5
+   echo "$as_me:13943: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16139,11 +16140,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16142: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16143: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16146: \$? = $ac_status" >&5
+   echo "$as_me:16147: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16407,11 +16408,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16410: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16411: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16414: \$? = $ac_status" >&5
+   echo "$as_me:16415: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16511,11 +16512,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16514: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16515: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16518: \$? = $ac_status" >&5
+   echo "$as_me:16519: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -28800,6 +28801,69 @@
 #define SDL_VIDEO_DRIVER_X11_DPMS 1
 _ACEOF
 
+                fi
+            fi
+            # Check whether --enable-video-x11-xf86-keysyms was given.
+if test "${enable_video_x11_xf86_keysyms+set}" = set; then
+  enableval=$enable_video_x11_xf86_keysyms;
+else
+  enable_video_x11_xf86_keysyms=yes
+fi
+
+            if test x$enable_video_x11_xf86_keysyms = xyes; then
+                { echo "$as_me:$LINENO: checking for XFree86 
Internet/MultiMedia Keyboard keysym support" >&5
+echo $ECHO_N "checking for XFree86 Internet/MultiMedia Keyboard keysym 
support... $ECHO_C" >&6; }
+                video_x11_xf86_keysyms=no
+                cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+                 #include <X11/XF86keysym.h>
+
+int
+main ()
+{
+
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+                video_x11_xf86_keysyms=yes
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+                { echo "$as_me:$LINENO: result: $video_x11_xf86_keysyms" >&5
+echo "${ECHO_T}$video_x11_xf86_keysyms" >&6; }
+                if test x$video_x11_xf86_keysyms = xyes; then
+                    EXTRA_CFLAGS="$EXTRA_CFLAGS -DXFREE86_KEYSYMS"
                 fi
             fi
         fi

Modified: 7.3/trunk/squeezeplay/src/SDL-1.2.13/configure.in
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/SDL-1.2.13/configure.in?rev=3083&root=Jive&r1=3082&r2=3083&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/SDL-1.2.13/configure.in (original)
+++ 7.3/trunk/squeezeplay/src/SDL-1.2.13/configure.in Wed Oct  8 08:11:42 2008
@@ -1101,6 +1101,23 @@
                                 ])
                 if test x$have_dpms_h_hdr = xyes; then
                     AC_DEFINE(SDL_VIDEO_DRIVER_X11_DPMS)
+                fi
+            fi
+            AC_ARG_ENABLE(video-x11-xf86-keysyms,
+[  --enable-video-x11-xf86-keysyms   use XFree86's Internet-Keyboard 
keysyms[default=yes]],
+                          , enable_video_x11_xf86_keysyms=yes)
+            if test x$enable_video_x11_xf86_keysyms = xyes; then
+                AC_MSG_CHECKING(for XFree86 Internet/MultiMedia Keyboard 
keysym support)
+                video_x11_xf86_keysyms=no
+                AC_TRY_COMPILE([
+                 #include <X11/XF86keysym.h>
+                ],[
+                ],[
+                video_x11_xf86_keysyms=yes
+                ])
+                AC_MSG_RESULT($video_x11_xf86_keysyms)
+                if test x$video_x11_xf86_keysyms = xyes; then
+                    EXTRA_CFLAGS="$EXTRA_CFLAGS -DXFREE86_KEYSYMS"
                 fi
             fi
         fi

Modified: 7.3/trunk/squeezeplay/src/SDL-1.2.13/include/SDL_keysym.h
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/SDL-1.2.13/include/SDL_keysym.h?rev=3083&root=Jive&r1=3082&r2=3083&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/SDL-1.2.13/include/SDL_keysym.h (original)
+++ 7.3/trunk/squeezeplay/src/SDL-1.2.13/include/SDL_keysym.h Wed Oct  8 
08:11:42 2008
@@ -281,6 +281,71 @@
        SDLK_EURO               = 321,          /* Some european keyboards */
        SDLK_UNDO               = 322,          /* Atari keyboard has Undo */
 
+    /* "Internet"/"MultiMedia" keyboards */
+    SDLK_Standby            = 323,
+    SDLK_AudioLowerVolume   = 324,
+    SDLK_AudioMute          = 325,
+    SDLK_AudioRaiseVolume   = 326,
+    SDLK_AudioPlay          = 327,
+    SDLK_AudioStop          = 328,
+    SDLK_AudioPrev          = 329,
+    SDLK_AudioNext          = 330,
+    SDLK_HomePage           = 331,
+    SDLK_Mail               = 332,
+    SDLK_Start              = 333,
+    SDLK_Search             = 334,
+    SDLK_AudioRecord        = 325,
+
+    SDLK_Calculator         = 326,
+    SDLK_Memo               = 327,
+    SDLK_ToDoList           = 328,
+    SDLK_Calendar           = 329,
+    SDLK_PowerDown          = 330,
+    SDLK_ContrastAdjust     = 331,
+    SDLK_RockerUp           = 332,
+    SDLK_RockerDown         = 333,
+    SDLK_RockerEnter        = 334,
+
+    SDLK_Back               = 335,
+    SDLK_Forward            = 336,
+    SDLK_Stop               = 337,
+    SDLK_Refresh            = 338,
+    SDLK_PowerOff           = 339,
+    SDLK_WakeUp             = 340,
+    SDLK_Eject              = 341,
+    SDLK_ScreenSaver        = 342,
+    SDLK_WWW                = 343,
+    SDLK_Sleep              = 344,
+    SDLK_Favorites          = 345,
+    SDLK_AudioPause         = 346,
+    SDLK_AudioMedia         = 347,
+    SDLK_MyComputer         = 348,
+    SDLK_VendorHome         = 349,
+    SDLK_LightBulb          = 350,
+    SDLK_Shop               = 351,
+    SDLK_History            = 352,
+    SDLK_OpenURL            = 353,
+    SDLK_AddFavorite        = 354,
+    SDLK_HotLinks           = 355,
+    SDLK_BrightnessAdjust   = 356,
+
+    SDLK_Launch0            = 357,
+    SDLK_Launch1            = 358,
+    SDLK_Launch2            = 359,
+    SDLK_Launch3            = 360,
+    SDLK_Launch4            = 361,
+    SDLK_Launch5            = 362,
+    SDLK_Launch6            = 363,
+    SDLK_Launch7            = 364,
+    SDLK_Launch8            = 365,
+    SDLK_Launch9            = 366,
+    SDLK_LaunchA            = 367,
+    SDLK_LaunchB            = 368,
+    SDLK_LaunchC            = 369,
+    SDLK_LaunchD            = 370,
+    SDLK_LaunchE            = 371,
+    SDLK_LaunchF            = 372,
+
        /* Add any other keys here */
 
        SDLK_LAST

Modified: 7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/x11/SDL_x11events.c
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/x11/SDL_x11events.c?rev=3083&root=Jive&r1=3082&r2=3083&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/x11/SDL_x11events.c 
(original)
+++ 7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/x11/SDL_x11events.c Wed Oct  
8 08:11:42 2008
@@ -48,6 +48,9 @@
 #include "SDL_x11mouse_c.h"
 #include "SDL_x11events_c.h"
 
+#ifdef XFREE86_KEYSYMS
+#include <X11/XF86keysym.h>
+#endif
 
 /* Define this if you want to debug X11 events */
 /*#define DEBUG_XEVENTS*/
@@ -1092,6 +1095,90 @@
        MISC_keymap[XK_Hyper_R&0xFF] = SDLK_MENU;   /* Windows "Menu" key */
 }
 
+#ifdef XFREE86_KEYSYMS
+/* Macro for trivial assignment from XFree86 value to SDL value */
+#define XF86_to_SDLK(x) \
+    case XF86XK_##x:    \
+        return SDLK_##x
+
+static SDLKey
+TranslateXFree86VendorSpecificKeysyms(KeySym xsym)
+{
+    switch (xsym) {
+        /* Keys found on some "Internet" keyboards. */
+        XF86_to_SDLK(Standby);
+        XF86_to_SDLK(AudioLowerVolume);
+        XF86_to_SDLK(AudioMute);
+        XF86_to_SDLK(AudioRaiseVolume);
+        XF86_to_SDLK(AudioPlay);
+        XF86_to_SDLK(AudioStop);
+        XF86_to_SDLK(AudioPrev);
+        XF86_to_SDLK(AudioNext);
+        XF86_to_SDLK(HomePage);
+        XF86_to_SDLK(Mail);
+        XF86_to_SDLK(Start);
+        XF86_to_SDLK(Search);
+        XF86_to_SDLK(AudioRecord);
+
+        /* These are sometimes found on PDA's (e.g. Palm, PocketPC or 
elsewhere) */
+        XF86_to_SDLK(Calculator);
+        XF86_to_SDLK(Memo);
+        XF86_to_SDLK(ToDoList);
+        XF86_to_SDLK(Calendar);
+        XF86_to_SDLK(PowerDown);
+        XF86_to_SDLK(ContrastAdjust);
+        XF86_to_SDLK(RockerUp);
+        XF86_to_SDLK(RockerDown);
+        XF86_to_SDLK(RockerEnter);
+
+        /* Some more "Internet" keyboard symbols */
+        XF86_to_SDLK(Back);
+        XF86_to_SDLK(Forward);
+        XF86_to_SDLK(Stop);
+        XF86_to_SDLK(Refresh);
+        XF86_to_SDLK(PowerOff);
+        XF86_to_SDLK(WakeUp);
+        XF86_to_SDLK(Eject);
+        XF86_to_SDLK(ScreenSaver);
+        XF86_to_SDLK(WWW);
+        XF86_to_SDLK(Sleep);
+        XF86_to_SDLK(Favorites);
+        XF86_to_SDLK(AudioPause);
+        XF86_to_SDLK(AudioMedia);
+        XF86_to_SDLK(MyComputer);
+        XF86_to_SDLK(VendorHome);
+        XF86_to_SDLK(LightBulb);
+        XF86_to_SDLK(Shop);
+        XF86_to_SDLK(History);
+        XF86_to_SDLK(OpenURL);
+        XF86_to_SDLK(AddFavorite);
+        XF86_to_SDLK(HotLinks);
+        XF86_to_SDLK(BrightnessAdjust);
+
+        XF86_to_SDLK(Launch0);
+        XF86_to_SDLK(Launch1);
+        XF86_to_SDLK(Launch2);
+        XF86_to_SDLK(Launch3);
+        XF86_to_SDLK(Launch4);
+        XF86_to_SDLK(Launch5);
+        XF86_to_SDLK(Launch7);
+        XF86_to_SDLK(Launch8);
+        XF86_to_SDLK(Launch9);
+        XF86_to_SDLK(LaunchA);
+        XF86_to_SDLK(LaunchB);
+        XF86_to_SDLK(LaunchC);
+        XF86_to_SDLK(LaunchD);
+        XF86_to_SDLK(LaunchE);
+        XF86_to_SDLK(LaunchF);
+
+        default:
+            return SDLK_UNKNOWN;
+    }
+}
+#endif
+
+
+
 /* Get the translated SDL virtual keysym */
 SDLKey X11_TranslateKeycode(Display *display, KeyCode kc)
 {
@@ -1138,6 +1225,12 @@
                    case 0xFF:
                        key = MISC_keymap[xsym&0xFF];
                        break;
+
+#ifdef XFREE86_KEYSYMS
+                    case 0x1008ff: /* XFree86 vendor specific keysyms from 
/usr/X11R6/include/X11/XF86keysym.h */
+                       key = TranslateXFree86VendorSpecificKeysyms(xsym);
+                       break;
+#endif
                    default:
                        /*
                        fprintf(stderr, "X11: Unhandled xsym, sym = 0x%04x\n",

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to