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

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
This commit is contained in:
2006-05-10 19:46:06 +00:00
parent d0acd78ad8
commit d5ae204275
3 changed files with 31 additions and 8 deletions

View 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:

View File

@@ -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);

View File

@@ -236,7 +236,7 @@ private :
GHOST_TKey
convertXKey(
unsigned int key
KeySym key
);
};