From: "Jan D." <jan.h.d@swipnet.se>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: AltGr finger twisters documented?
Date: Wed, 6 Jul 2005 10:38:25 +0200 [thread overview]
Message-ID: <D53FE12C-73DD-4B3A-BC6C-A2EE5FC1CD51@swipnet.se> (raw)
In-Reply-To: <wlirzohjf0.wl%mituharu@math.s.chiba-u.ac.jp>
>> Well, GNU/Linux in many flavors, FreeBSD, Solaris, MacOSX (but there
>> I have no idea how to get C-\).
>>
>
> As for Mac OS X/Carbon, could you test if you can type C-\ with "Ctrl
> + [the key combination for '\']" with the following patch?
>
>
It seems to work fine on initial testing. I'll run Emacs with this
patch for a while. Actually \ is on option-shift-7 so C-\ becomes
option-shift-ctrl-7, and M-C-\ is command-option-shift-ctrl-7. Not
so bad as it looks, because option, ctrl, shift and command are all
close to each other.
Jan D.
> Index: src/macterm.c
> ===================================================================
> RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
> retrieving revision 1.120
> diff -c -r1.120 macterm.c
> *** src/macterm.c 4 Jul 2005 16:06:33 -0000 1.120
> --- src/macterm.c 6 Jul 2005 00:13:57 -0000
> ***************
> *** 93,99 ****
> #define macMetaKey (NILP (Vmac_reverse_ctrl_meta) ? \
> (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey) \
> : controlKey)
> ! #define macAltKey (NILP (Vmac_command_key_is_meta) ?
> cmdKey : optionKey)
>
> #define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))-
> >mFP)
> \f
> --- 93,101 ----
> #define macMetaKey (NILP (Vmac_reverse_ctrl_meta) ? \
> (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey) \
> : controlKey)
> ! #define macAltKey (NILP (Vmac_command_key_is_meta) ? \
> ! (NILP (Vmac_command_key_is_meta) ? cmdKey : optionKey) \
> ! : 0)
>
> #define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))-
> >mFP)
> \f
> ***************
> *** 7537,7543 ****
> result |= ctrl_modifier;
> if (mods & macMetaKey)
> result |= meta_modifier;
> ! if (NILP (Vmac_command_key_is_meta) && (mods & macAltKey))
> result |= alt_modifier;
> if (!NILP (Vmac_option_modifier) && (mods & optionKey)) {
> Lisp_Object val = Fget(Vmac_option_modifier, Qmodifier_value);
> --- 7539,7545 ----
> result |= ctrl_modifier;
> if (mods & macMetaKey)
> result |= meta_modifier;
> ! if (mods & macAltKey)
> result |= alt_modifier;
> if (!NILP (Vmac_option_modifier) && (mods & optionKey)) {
> Lisp_Object val = Fget(Vmac_option_modifier, Qmodifier_value);
> ***************
> *** 9479,9487 ****
> }
> else
> {
> ! if (er.modifiers & (controlKey |
> ! (NILP (Vmac_command_key_is_meta) ? optionKey
> ! : cmdKey)))
> {
> /* This code comes from Keyboard Resource,
> Appendix C of IM - Text. This is necessary
> --- 9481,9492 ----
> }
> else
> {
> ! EventModifiers mask = macCtrlKey | macMetaKey | macAltKey;
> !
> ! if (!NILP (Vmac_option_modifier))
> ! mask |= optionKey;
> !
> ! if (er.modifiers & mask)
> {
> /* This code comes from Keyboard Resource,
> Appendix C of IM - Text. This is necessary
> ***************
> *** 9490,9513 ****
> It also does not translate correctly
> control-shift chars like C-% so mask off shift
> here also */
> ! int new_modifiers = er.modifiers & 0xe600;
> ! /* mask off option and command */
> ! int new_keycode = keycode | new_modifiers;
> ! Ptr kchr_ptr = (Ptr) GetScriptManagerVariable
> (smKCHRCache);
> ! unsigned long some_state = 0;
> ! inev.code = KeyTranslate (kchr_ptr, new_keycode,
> ! &some_state) & 0xff;
> ! }
> ! else if (!NILP (Vmac_option_modifier)
> ! && (er.modifiers & optionKey))
> ! {
> ! /* When using the option key as an emacs modifier,
> ! convert the pressed key code back to one
> ! without the Mac option modifier applied. */
> ! int new_modifiers = er.modifiers & ~optionKey;
> ! int new_keycode = keycode | new_modifiers;
> Ptr kchr_ptr = (Ptr) GetScriptManagerVariable
> (smKCHRCache);
> ! unsigned long some_state = 0;
> inev.code = KeyTranslate (kchr_ptr, new_keycode,
> &some_state) & 0xff;
> }
> --- 9495,9506 ----
> It also does not translate correctly
> control-shift chars like C-% so mask off shift
> here also */
> ! EventModifiers new_modifiers = er.modifiers & ~mask;
> ! /* mask off modifiers */
> ! UInt16 new_keycode = keycode | new_modifiers & 0xff00;
> Ptr kchr_ptr = (Ptr) GetScriptManagerVariable
> (smKCHRCache);
> ! UInt32 some_state = 0;
> !
> inev.code = KeyTranslate (kchr_ptr, new_keycode,
> &some_state) & 0xff;
> }
>
>
> _______________________________________________
> Emacs-devel mailing list
> Emacs-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-devel
>
next prev parent reply other threads:[~2005-07-06 8:38 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-05 9:34 AltGr finger twisters documented? Juanma Barranquero
2005-07-05 10:45 ` Kim F. Storm
2005-07-05 10:55 ` Jan D.
2005-07-05 12:13 ` Mathias Dahl
2005-07-05 13:39 ` Juanma Barranquero
2005-07-05 12:34 ` Lennart Borgman
2005-07-05 14:00 ` Jan D.
2005-07-05 14:05 ` Juanma Barranquero
2005-07-06 0:23 ` YAMAMOTO Mitsuharu
2005-07-06 8:38 ` Jan D. [this message]
2005-07-05 12:41 ` Lennart Borgman
2005-07-05 14:03 ` Jan D.
2005-07-05 14:10 ` Juanma Barranquero
2005-07-05 14:55 ` Jan D.
2005-07-05 16:16 ` Lennart Borgman
2005-07-05 16:34 ` Juanma Barranquero
2005-07-05 16:37 ` Jason Rumney
2005-07-05 16:40 ` Juanma Barranquero
2005-07-05 19:30 ` Jason Rumney
2005-07-05 19:44 ` Juanma Barranquero
2005-07-05 21:09 ` Jason Rumney
2005-07-05 17:00 ` Lennart Borgman
2005-07-05 17:32 ` Lennart Borgman
2005-07-05 21:21 ` Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2005-07-05 11:15 LENNART BORGMAN
2005-07-05 11:19 ` Juanma Barranquero
2005-07-05 12:18 ` Jason Rumney
2005-07-05 12:46 ` Lennart Borgman
2005-07-05 13:28 ` Juanma Barranquero
2005-07-05 12:40 ` Lennart Borgman
2005-07-05 11:18 LENNART BORGMAN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D53FE12C-73DD-4B3A-BC6C-A2EE5FC1CD51@swipnet.se \
--to=jan.h.d@swipnet.se \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.