[Bf-committers] [bf-commiters] bug #799 reloaded, working fix but partial
Jean-Luc Peurière
bf-committers@blender.org
Sun, 11 Apr 2004 10:17:26 +0200
Below is a patch which fix the bug on non-US keyboards.
keyboard keys where the unmodified state was not present on an US
keyboard without modifiers
were filtered out.
It is now possible to type any character which is in*both* mac_roman
and iso_latin tables.
However this is only a partial fix for two reasons :
- first the key handler will now forward GHOST_kKeyUnknown events.
This should not break anything but that is a difference which must be
accounted for.
- upper row numerals are not recognized as such, and so cannot be typed
in scale fields for example.
cvs server: Diffing .
Index: GHOST_SystemCarbon.cpp
===================================================================
RCS file:
/cvsroot/bf-blender/blender/intern/ghost/intern/
GHOST_SystemCarbon.cpp,v
retrieving revision 1.14
diff -u -r1.14 GHOST_SystemCarbon.cpp
--- GHOST_SystemCarbon.cpp 31 Dec 2003 15:47:09 -0000 1.14
+++ GHOST_SystemCarbon.cpp 11 Apr 2004 08:06:58 -0000
@@ -179,7 +179,7 @@
}
}
- // printf("GHOST: unknown key: %d %d\n", vk, rawCode);
+ // printf("GHOST: unknown key: %d %d |%c|\n", vk, rawCode,vk);
return GHOST_kKeyUnknown;
}
@@ -747,6 +747,8 @@
err = noErr;
switch (kind) {
+ GHOST_TEventType type;
+
case kEventRawKeyDown:
case kEventRawKeyRepeat:
case kEventRawKeyUp:
@@ -755,18 +757,16 @@
key = convertKey(rawCode);
ascii= convertRomanToLatin(ascii);
-
- if (key!=GHOST_kKeyUnknown) {
- GHOST_TEventType type;
- if (kind == kEventRawKeyDown) {
- type = GHOST_kEventKeyDown;
- } else if (kind == kEventRawKeyRepeat) {
- type = GHOST_kEventKeyDown; /*
XXX, fixme */
- } else {
- type = GHOST_kEventKeyUp;
- }
- pushEvent( new GHOST_EventKey(
getMilliSeconds(), type, window, key, ascii) );
+
+ if (kind == kEventRawKeyDown) {
+ type = GHOST_kEventKeyDown;
+ } else if (kind == kEventRawKeyRepeat) {
+ type = GHOST_kEventKeyDown; /* XXX,
fixme */
+ } else {
+ type = GHOST_kEventKeyUp;
}
+ pushEvent( new GHOST_EventKey(
getMilliSeconds(), type, window, key, ascii) );
+
break;
case kEventRawKeyModifiersChanged:
========================================================================
===
--
Jean-luc