Author: tom
Date: Fri Oct 10 09:14:08 2008
New Revision: 3098

URL: http://svn.slimdevices.com?rev=3098&root=Jive&view=rev
Log:
For controller, replaced standard character key input translation to multimedia 
keys, added support for this in jive_framework.c

Modified:
    7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c
    7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c

Modified: 7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c?rev=3098&root=Jive&r1=3097&r2=3098&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c 
(original)
+++ 7.3/trunk/squeezeplay/src/SDL-1.2.13/src/video/fbcon/SDL_fbevents.c Fri Oct 
10 09:14:08 2008
@@ -61,8 +61,8 @@
 /* The translation tables from a console scancode to a SDL keysym */
 #define NUM_VGAKEYMAPS (1<<KG_CAPSSHIFT)
 static Uint16 vga_keymap[NUM_VGAKEYMAPS][NR_KEYS];
-static SDLKey keymap[128];
-static Uint16 keymap_temp[128]; /* only used at startup */
+static SDLKey keymap[210];
+static Uint16 keymap_temp[210]; /* only used at startup */
 static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym);
 
 /* Ugh, we have to duplicate the kernel's keysym mapping code...
@@ -989,14 +989,27 @@
        int pressed;
        int scancode;
        SDL_keysym keysym;
-
        nread = read(keyboard_fd, keybuf, BUFSIZ);
-       for ( i=0; i<nread; ++i ) {
-               scancode = keybuf[i] & 0x7F;
-               if ( keybuf[i] & 0x80 ) {
-                       pressed = SDL_RELEASED;
+       for ( i = 0; i<nread; ++i ) {
+               if ( ((keybuf[i] == 0) || keybuf[i] == 128) && (nread-i >= 2) 
&& keybuf[i + 1] == 129) {
+                       /* is extended character (scancode>128), comes in as 
three codes,
+                       first code: 0(pressed) or 128(released), second code:129
+                       third code: actual extended scancode value */
+                       scancode = keybuf[i + 2];
+                       if (keybuf[i] == 0) {
+                               pressed = SDL_PRESSED;
+                       } else {
+                               pressed = SDL_RELEASED;
+                       }
+                       //push past next 2 since the set of 3 are the extended 
character representation
+                       i += 2;
                } else {
-                       pressed = SDL_PRESSED;
+                       scancode = keybuf[i] & 0x7F;
+                       if ( keybuf[i] & 0x80 ) {
+                               pressed = SDL_RELEASED;
+                       } else {
+                               pressed = SDL_PRESSED;
+                       }
                }
                TranslateKey(scancode, &keysym);
                /* Handle Ctrl-Alt-FN for vt switch */
@@ -1124,6 +1137,24 @@
          case 127:
            keymap[i] = SDLK_MENU;
            break;
+         case 114:
+           keymap[i] = SDLK_AudioLowerVolume;
+           break;
+         case 115:
+           keymap[i] = SDLK_AudioRaiseVolume;
+           break;
+         case 163:
+           keymap[i] = SDLK_AudioNext;
+           break;
+         case 164:
+           keymap[i] = SDLK_AudioPause;
+           break;
+         case 165:
+           keymap[i] = SDLK_AudioPrev;
+           break;
+         case 207:
+           keymap[i] = SDLK_AudioPlay;
+           break;
          /* this should take care of all standard ascii keys */
          default:
            keymap[i] = KVAL(vga_keymap[0][i]);

Modified: 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c?rev=3098&root=Jive&r1=3097&r2=3098&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c (original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/src/ui/jive_framework.c Fri Oct 10 
09:14:08 2008
@@ -76,19 +76,26 @@
        { SDLK_k,               JIVE_KEY_DOWN },
        { SDLK_j,               JIVE_KEY_LEFT },
        { SDLK_l,               JIVE_KEY_RIGHT },
-       { SDLK_h,               JIVE_KEY_HOME },
+       { SDLK_HOME,            JIVE_KEY_HOME },
        { SDLK_p,               JIVE_KEY_PLAY },
        { SDLK_x,               JIVE_KEY_PLAY },
+       { SDLK_AudioPlay,       JIVE_KEY_PLAY },
        { SDLK_c,               JIVE_KEY_PAUSE },
        { SDLK_SPACE,           JIVE_KEY_PAUSE },
+       { SDLK_AudioPause,      JIVE_KEY_PAUSE },
        { SDLK_a,               JIVE_KEY_ADD },
+       { SDLK_KP_PLUS,         JIVE_KEY_ADD },
        { SDLK_z,               JIVE_KEY_REW },
        { SDLK_LESS,            JIVE_KEY_REW },
+       { SDLK_AudioPrev,       JIVE_KEY_REW },
        { SDLK_b,               JIVE_KEY_FWD },
        { SDLK_GREATER,         JIVE_KEY_FWD },
+       { SDLK_AudioNext,       JIVE_KEY_FWD },
        { SDLK_PLUS,            JIVE_KEY_VOLUME_UP },
        { SDLK_EQUALS,          JIVE_KEY_VOLUME_UP },
+       { SDLK_AudioRaiseVolume,JIVE_KEY_VOLUME_UP },
        { SDLK_MINUS,           JIVE_KEY_VOLUME_DOWN },
+       { SDLK_AudioLowerVolume,JIVE_KEY_VOLUME_DOWN },
        { SDLK_UNKNOWN,         JIVE_KEY_NONE },
 };
 

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

Reply via email to