From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: AltGr finger twisters documented? Date: Wed, 06 Jul 2005 09:23:15 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <42CA7E70.7040308@student.lu.se> <0726706D-47B7-4BFC-A960-2C5EE59DA7B3@swipnet.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: sea.gmane.org 1120610187 2378 80.91.229.2 (6 Jul 2005 00:36:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 6 Jul 2005 00:36:27 +0000 (UTC) Cc: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 06 02:36:26 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DpxtQ-0007Pj-M3 for ged-emacs-devel@m.gmane.org; Wed, 06 Jul 2005 02:36:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dpxui-00081d-84 for ged-emacs-devel@m.gmane.org; Tue, 05 Jul 2005 20:37:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dpxtg-0007r9-Gc for emacs-devel@gnu.org; Tue, 05 Jul 2005 20:36:16 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DpxtY-0007lj-5Z for emacs-devel@gnu.org; Tue, 05 Jul 2005 20:36:09 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpxtX-0007cr-LE for emacs-devel@gnu.org; Tue, 05 Jul 2005 20:36:07 -0400 Original-Received: from [133.82.132.2] (helo=mathmail.math.s.chiba-u.ac.jp) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DpxnE-0004YQ-Nv for emacs-devel@gnu.org; Tue, 05 Jul 2005 20:29:37 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 7C1312CAD; Wed, 6 Jul 2005 09:23:15 +0900 (JST) Original-To: "Jan D." In-Reply-To: <0726706D-47B7-4BFC-A960-2C5EE59DA7B3@swipnet.se> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/22.0.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:40477 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40477 >>>>> On Tue, 5 Jul 2005 16:00:05 +0200, "Jan D." 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) --- 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) *************** *** 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; }