Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorKent Mein <mein@cs.umn.edu>2006-05-10 23:46:06 +0400
committerKent Mein <mein@cs.umn.edu>2006-05-10 23:46:06 +0400
commitd5ae204275becc4915e24aa1bb38cbb1404429e7 (patch)
tree91a96fcf35037466a08a3944674ef6806fb13598 /intern
parentd0acd78ad81cdcf0c595948a5ffb4cb46660f46e (diff)
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
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_EventPrinter.cpp17
-rwxr-xr-xintern/ghost/intern/GHOST_SystemX11.cpp20
-rwxr-xr-xintern/ghost/intern/GHOST_SystemX11.h2
3 files changed, 31 insertions, 8 deletions
diff --git a/intern/ghost/intern/GHOST_EventPrinter.cpp b/intern/ghost/intern/GHOST_EventPrinter.cpp
index 759f3f137c9..ad65d1fbb18 100644
--- a/intern/ghost/intern/GHOST_EventPrinter.cpp
+++ b/intern/ghost/intern/GHOST_EventPrinter.cpp
@@ -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:
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index cc260f3b812..e6d1962958a 100755
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -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);
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 36d974fd5f3..c8d8d73404a 100755
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -236,7 +236,7 @@ private :
GHOST_TKey
convertXKey(
- unsigned int key
+ KeySym key
);
};