On 6 Nov 2008, at 18:34, matthiasm wrote:
> On 06.11.2008, at 10:58, MacArthur, Ian (SELEX GALILEO, UK) wrote:
>> 1: Does anyone else see this bug, or is it just me?
>
> It's just you and everyone else who is belo 10.5. There is additional
> code missing for pre-10.5 handling.
Oh OK. Just a few stragglers then... :-)
>> 2: At line 1290 I have replaced the:
>> #if 0
>> With something like (not at a Mac right now...)
>> #ifndef MACOS_VERSION_10_5
>>
The actual patch I am proposing as the short-term workaround is
attached below for consideration.
What I envisage for the "better" fix goes something like this:
We write two functions - one that wraps the old code, one wrapping
the new code. Both are compiled in. At run-time, when creating the
fltk context, the OS versions is scoped, and one or other of the
functions is assigned to a function pointer that is used by
carbonKeyboardHandler() to get the keystrokes (i.e. in the place of
the new keycodeToUnicode() function).
Does that sound (a) like the right approach and (b) feasible?
If so, I might see if I can come up with something, as I'd like this
to work!
> It is probably best to commit the #if change to svn because it will
> take me a while before I can commit the final version.
OK. I don't actually have dev access (but maybe I should apply) so if
someone else can push this in the meantime I'd be grateful...
--------------
--- Fl_mac.cxx 2008-11-05 19:51:05.000000000 +0000
+++ Fl_mac.imm.cxx 2008-11-05 20:30:50.000000000 +0000
@@ -1189,7 +1189,7 @@
*deadKeyStatePtr = 0;
if (noErr != status) {
- fprintf(stderr,"UCKeyTranslate failed: %d", (int) status);
+ fprintf(stderr,"UCKeyTranslate failed: %d\n", (int) status);
actuallength = 0;
}
// FIXME no bounds check (see maxchars)
@@ -1287,7 +1287,8 @@
// Matt: to Carbon. The kEventKeyModifierNumLockMask is only
set when
// Matt: a numeric keypad key is pressed and does not
correspond with
// Matt: the NumLock light in PowerBook keyboards.
-#if 0
+#ifndef MAC_OS_X_VERSION_10_5
+ // Version 10.4 or earlier will not support Matts new
keycodeToUnicode() method...
if ( (sym >= FL_KP && sym <= FL_KP_Last) || !(sym & 0xff00) ||
sym == FL_Tab || sym == FL_Enter) {
buffer[0] = key;
--------------
Cheers,
--
Ian
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk