From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: AltGr finger twisters documented?
Date: Wed, 06 Jul 2005 09:23:15 +0900 [thread overview]
Message-ID: <wlirzohjf0.wl%mituharu@math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <0726706D-47B7-4BFC-A960-2C5EE59DA7B3@swipnet.se>
>>>>> On Tue, 5 Jul 2005 16:00:05 +0200, "Jan D." <jan.h.d@swipnet.se> said:
> 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?
YAMAMOTO Mitsuharu
mituharu@math.s.chiba-u.ac.jp
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;
}
next prev parent reply other threads:[~2005-07-06 0:23 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 [this message]
2005-07-06 8:38 ` Jan D.
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wlirzohjf0.wl%mituharu@math.s.chiba-u.ac.jp \
--to=mituharu@math.s.chiba-u.ac.jp \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).