Hi Mike,

> Anyone got a pointer to the patch?

Below is an old posting that contains a patch for the modifier keys on
OS X.  I've just verified that the same patch and instructions also
work for LyX 1.3.6 and Qt/Mac 3.3.5.  The end result should be that
your Command key maps to LyX's meta key (M-...), and your Control key
(as well as Caps Lock, if you're using uControl :-) to LyX's control
key (C-...).

You can find a patched binary distribution at
http://www.eecs.harvard.edu/~jason/temp/LyX-1.3.6-2Mac-keypatch.dmg. 
It doesn't include the new installer script, so you might prefer to
install using the official binary, then drag the patched LyX.app over
the installed one to replace it.

I can't guarantee the binary will be there forever, but I haven't
gotten around to either lobbying to make these bindings the default or
proposing a more flexible solution, so I'll keep it up as long as I
can.

regards,

        -j

Jason Woodard


Begin forwarded message:

From: Jason Woodard <[EMAIL PROTECTED]>
Date: November 22, 2004 12:19:46 PM GMT+08:00
To: LyX-Users <lyx-users@lists.lyx.org>
Cc: Chris Menzel <[EMAIL PROTECTED]>
Subject: Qt mods: LyX/Mac modifier keys

Hi,

Following an earlier discussion of how to change the modifier key
bindings for Mac OS X, Chris Menzel asked me to post the changes I
made to build a "fixed" version of 1.3.4:

> Can you make your changes to Qt available so that Mac folks like me
> don't have to ask you to recompile LyX every time a new version becomes
> available?  :-)  I'd like to compile 1.3.5, but definitely need to avoid
> that nasty, non-emacsy Ctrl->Cmd key mapping.

The patch needed for Qt 3.3.3 / LyX 1.3.5 is actually the same as the
one I posted in September, but I'm reposting it at the end of this
note for convenience.  To build 1.3.5, I downloaded the source
distribution from ftp.lyx.org and followed the instructions in
README.MacOSX, using Qt 3.3.3 and the configuration flags "to make a
build that works with both 10.2 and 10.3."  The only thing I did
differently was to apply a patch file before compiling Qt.

To create the patch file, cut and paste the text at the end of this
note into a plain text file; call it anything and put it anywhere you
like.  (You can even paste the whole note--the patch program is very
forgiving.)  Then, from the top of the Qt source hierarchy, issue the
command:

patch -p0 < YOUR-PATCH-FILE

where YOUR-PATCH-FILE is of course the path to the patch file you
created.  Patch should respond with:

patching file src/kernel/qapplication_mac.cpp
Hunk #1 succeeded at 1225 (offset 281 lines).

That's it--the rest of the build should work as advertised.

(And now that you know how to fish, I shouldn't mention that I've
posted a new binary at
http://www.eecs.harvard.edu/~jason/temp/lyx-1.3.5_macos-aqua-emacs.dmg,
but there it is :-)

Please let me know if you encounter any difficulties.

regards,

        -j

Jason Woodard
[EMAIL PROTECTED]



--- src/kernel/qapplication_mac.cpp.orig        Thu Jun 19 01:35:24 2003
+++ src/kernel/qapplication_mac.cpp     Wed Sep 15 14:39:45 2004
@@ -944,11 +944,11 @@
 static key_sym modifier_syms[] = {
 { shiftKey, MAP_KEY(Qt::ShiftButton) },
 { rightShiftKeyBit, MAP_KEY(Qt::ShiftButton) },
-{ controlKey, MAP_KEY(Qt::MetaButton) },
-{ rightControlKey, MAP_KEY(Qt::MetaButton) },
-{ cmdKey, MAP_KEY(Qt::ControlButton) },
-{ optionKey, MAP_KEY(Qt::AltButton) },
-{ rightOptionKey, MAP_KEY(Qt::AltButton) },
+{ controlKey, MAP_KEY(Qt::ControlButton) },
+{ rightControlKey, MAP_KEY(Qt::ControlButton) },
+{ cmdKey, MAP_KEY(Qt::AltButton) },
+// { optionKey, MAP_KEY(Qt::AltButton) },
+// { rightOptionKey, MAP_KEY(Qt::AltButton) },
 { kEventKeyModifierNumLockMask, MAP_KEY(Qt::Keypad) },
 {   0, MAP_KEY(0) } };
 static int get_modifiers(int key, bool from_mouse=FALSE)

Reply via email to