This is a bit of a hack, but it looks like sun
authorKent Mein <mein@cs.umn.edu>
Wed, 10 May 2006 19:46:06 +0000 (19:46 +0000)
committerKent Mein <mein@cs.umn.edu>
Wed, 10 May 2006 19:46:06 +0000 (19:46 +0000)
                  Used F11 and friends for its special keys Stop,again etc..
                  So this little patch enables F11 and F12 to work as expected
                  following link has documentation on it:
                  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4734408
                  also from /usr/include/X11/Sunkeysym.h
#define SunXK_F36               0x1005FF10      // Labeled F11
#define SunXK_F37               0x1005FF11      // Labeled F12

I also added a comment explaning why the heck its there...

What this means is XK_F11 and XK_F12 do not line up with the F11 and F12
keys on sun keyboards.  So I've added special cases to correct the issue.

Doing a quick grep for XK_F shows there are some files in the
gameengine that use them when they probably shouldn't, but I'm not going to
attempt to fix them, Files that should be looked at are:
gameengine/BlenderRoutines/KX_BlenderInputDevice.h
gameengine/Converter/KX_ConvertSensors.cpp
gameengine/GameLogic/SCA_IInputDevice.h
gameengine/GamePlayer/common/unix/GPU_KeyboardDevice.cpp
gameengine/GamePlayer/common/windows/GPW_KeyboardDevice.cpp
gameengine/GamePlayer/ghost/GPG_KeyboardDevice.cpp
gameengine/Ketsji/KX_PythonInit.cpp

Kent

intern/ghost/intern/GHOST_EventPrinter.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h

index 759f3f137c9227ec354d56d520a0e9e01b1d4f95..ad65d1fbb1880d5589d2ef1878e4585a3d85ff3e 100644 (file)
@@ -133,20 +133,25 @@ void GHOST_EventPrinter::getKeyString(GHOST_TKey key, STR_String& str) const
 {
        if ((key >= GHOST_kKeyComma) && (key <= GHOST_kKeyRightBracket)) {
                str = ((char)key);
-       }
-       else if ((key >= GHOST_kKeyNumpad0) && (key <= GHOST_kKeyNumpad9)) {
+       } else if ((key >= GHOST_kKeyNumpad0) && (key <= GHOST_kKeyNumpad9)) {
                int number = key - GHOST_kKeyNumpad0;
                STR_String numberStr (number);
                str = "Numpad";
                str += numberStr;
-       }
-       else if ((key >= GHOST_kKeyF1) && (key <= GHOST_kKeyF24)) {
+#if defined(__sun__) || defined(__sun)
+       } else if (key == 268828432) { /* solaris keyboards are messed up */
+                /* This should really test XK_F11 but that doesn't work */
+               str = "F11";
+       } else if (key == 268828433) { /* solaris keyboards are messed up */
+                /* This should really test XK_F12 but that doesn't work */
+               str = "F12";
+#endif
+       } else if ((key >= GHOST_kKeyF1) && (key <= GHOST_kKeyF24)) {
                int number = key - GHOST_kKeyF1 + 1;
                STR_String numberStr (number);
                str = "F";
                str += numberStr;
-       }
-       else {
+       } else {
                switch (key)
                {
                case GHOST_kKeyBackSpace:
index cc260f3b812573952ec079854655ed7745fbc679..e6d1962958a2401005097d368c5b051f4d4a6ed8 100755 (executable)
@@ -723,7 +723,7 @@ generateWindowExposeEvents(
        GHOST_TKey
 GHOST_SystemX11::
 convertXKey(
-       unsigned int key
+       KeySym key
 ){
        GHOST_TKey type;
 
@@ -735,6 +735,24 @@ convertXKey(
                type = GHOST_TKey(key - XK_0 + int(GHOST_kKey0));
        } else if ((key >= XK_F1) && (key <= XK_F24)) {
                type = GHOST_TKey(key - XK_F1 + int(GHOST_kKeyF1));
+#if defined(__sun) || defined(__sun__) 
+               /* This is a bit of a hack, but it looks like sun
+                  Used F11 and friends for its special keys Stop,again etc..
+                  So this little patch enables F11 and F12 to work as expected
+                  following link has documentation on it: 
+                  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4734408
+                  also from /usr/include/X11/Sunkeysym.h 
+#define SunXK_F36               0x1005FF10      // Labeled F11
+#define SunXK_F37               0x1005FF11      // Labeled F12 
+
+                               mein@cs.umn.edu
+                */
+               
+       } else if (key == 268828432) {
+               type = GHOST_kKeyF11;
+       } else if (key == 268828433) {
+               type = GHOST_kKeyF12;
+#endif
        } else {
                switch(key) {
                        GXMAP(type,XK_BackSpace,        GHOST_kKeyBackSpace);
index 36d974fd5f3c8484cfa3ac919d3a1f6ca99810a1..c8d8d73404a531fbf62a373c9c84e5f320bdf168 100755 (executable)
@@ -236,7 +236,7 @@ private :
  
                GHOST_TKey
        convertXKey(
-               unsigned int key
+               KeySym key
        );
 
 };