emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OS X] Delete key should delete forward


From: YAMAMOTO Mitsuharu
Subject: Re: [OS X] Delete key should delete forward
Date: Fri, 25 Feb 2005 15:02:45 +0900
User-agent: Wanderlust/2.12.2 (99 Luftballons) 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)

>>>>> On Mon, 21 Feb 2005 23:52:19 +0100, Jesper Harder <address@hidden> said:

> Two other small problems which are probably located in the same part
> of the code:

> 1.  On a powerbook keyboard, the 'enter' key (located next to the
> right Cmd-key -- and with the same keycap as keypad-enter on a
> full-size keyboard) is interpreted as `C-c' by Emacs.

> 2.  The 'clear' key (on the numeric keypad on a full-size keyboard)
> is seen as ESC by Emacs.  I'm not sure which command (if any) should
> be bound to the key by default -- maybe `delete-region' which seems
> be what it's intended for.

The previously posted patch did so in imitation of Apple X11.  This
time these keys are mapped as follows:

   enter (on PowerBook) -> kp-enter
   fn + enter (on PowerBook) -> linefeed
   clear (on KeyPad) -> clear

                                     YAMAMOTO Mitsuharu
                                address@hidden
Index: lisp/startup.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/startup.el,v
retrieving revision 1.338
diff -c -r1.338 startup.el
*** lisp/startup.el     12 Feb 2005 18:00:53 -0000      1.338
--- lisp/startup.el     25 Feb 2005 06:01:04 -0000
***************
*** 748,754 ****
--- 748,757 ----
    (unless noninteractive
      ;; DOS/Windows systems have a PC-type keyboard which has both
      ;; <delete> and <backspace> keys.
+     ;; On Mac, Delete and Forward Delete keys are mapped to
+     ;; <backspace> and <delete>, respectively.
      (when (or (memq system-type '(ms-dos windows-nt))
+             (eq window-system 'mac)
              (and (memq window-system '(x))
                   (fboundp 'x-backspace-delete-keys-p)
                   (x-backspace-delete-keys-p))
Index: lisp/term/mac-win.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/term/mac-win.el,v
retrieving revision 1.33
diff -c -r1.33 mac-win.el
*** lisp/term/mac-win.el        21 Feb 2005 13:09:58 -0000      1.33
--- lisp/term/mac-win.el        25 Feb 2005 06:01:04 -0000
***************
*** 1010,1029 ****
  
  ;; Map certain keypad keys into ASCII characters
  ;; that people usually expect.
- (define-key function-key-map [return] [?\C-m])
- (define-key function-key-map [M-return] [?\M-\C-m])
- (define-key function-key-map [tab] [?\t])
- (define-key function-key-map [M-tab] [?\M-\t])
  (define-key function-key-map [backspace] [?\d])
! (define-key function-key-map [M-backspace] [?\M-\d])
  (define-key function-key-map [escape] [?\e])
  (define-key function-key-map [M-escape] [?\M-\e])
  
  ;; These tell read-char how to convert
  ;; these special chars to ASCII.
- (put 'return 'ascii-character ?\C-m)
- (put 'tab 'ascii-character ?\t)
  (put 'backspace 'ascii-character ?\d)
  (put 'escape 'ascii-character ?\e)
  
  
--- 1010,1038 ----
  
  ;; Map certain keypad keys into ASCII characters
  ;; that people usually expect.
  (define-key function-key-map [backspace] [?\d])
! (define-key function-key-map [delete] [?\d])
! (define-key function-key-map [tab] [?\t])
! (define-key function-key-map [linefeed] [?\n])
! (define-key function-key-map [clear] [?\C-l])
! (define-key function-key-map [return] [?\C-m])
  (define-key function-key-map [escape] [?\e])
+ (define-key function-key-map [M-backspace] [?\M-\d])
+ (define-key function-key-map [M-delete] [?\M-\d])
+ (define-key function-key-map [M-tab] [?\M-\t])
+ (define-key function-key-map [M-linefeed] [?\M-\n])
+ (define-key function-key-map [M-clear] [?\M-\C-l])
+ (define-key function-key-map [M-return] [?\M-\C-m])
  (define-key function-key-map [M-escape] [?\M-\e])
  
  ;; These tell read-char how to convert
  ;; these special chars to ASCII.
  (put 'backspace 'ascii-character ?\d)
+ (put 'delete 'ascii-character ?\d)
+ (put 'tab 'ascii-character ?\t)
+ (put 'linefeed 'ascii-character ?\n)
+ (put 'clear 'ascii-character ?\C-l)
+ (put 'return 'ascii-character ?\C-m)
  (put 'escape 'ascii-character ?\e)
  
  
Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.102
diff -c -r1.102 macterm.c
*** src/macterm.c       3 Feb 2005 11:57:36 -0000       1.102
--- src/macterm.c       25 Feb 2005 06:01:05 -0000
***************
*** 8432,8450 ****
  #endif
  
  /* Table for translating Mac keycode to X keysym values.  Contributed
!    by Sudhir Shenoy.  */
  static unsigned char keycode_to_xkeysym_table[] = {
    /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  
    /*0x30*/ 0x09 /*tab*/, 0 /*0x0020 space*/, 0, 0x08 /*backspace*/,
!   /*0x34*/ 0, 0x1b /*escape*/, 0, 0,
    /*0x38*/ 0, 0, 0, 0,
    /*0x3C*/ 0, 0, 0, 0,
  
    /*0x40*/ 0, 0xae /*kp-.*/, 0, 0xaa /*kp-**/,
!   /*0x44*/ 0, 0xab /*kp-+*/, 0, 0x7f /*kp-clear*/,
    /*0x48*/ 0, 0, 0, 0xaf /*kp-/*/,
    /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp--*/, 0,
  
--- 8432,8454 ----
  #endif
  
  /* Table for translating Mac keycode to X keysym values.  Contributed
!    by Sudhir Shenoy.
!    Mapping for special keys is now identical to that in Apple X11
!    except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>)
!    on the right of the Cmd key on laptops, and fn + `enter' (->
!    <linefeed>). */
  static unsigned char keycode_to_xkeysym_table[] = {
    /*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    /*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    /*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  
    /*0x30*/ 0x09 /*tab*/, 0 /*0x0020 space*/, 0, 0x08 /*backspace*/,
!   /*0x34*/ 0x8d /*enter on laptops*/, 0x1b /*escape*/, 0, 0,
    /*0x38*/ 0, 0, 0, 0,
    /*0x3C*/ 0, 0, 0, 0,
  
    /*0x40*/ 0, 0xae /*kp-.*/, 0, 0xaa /*kp-**/,
!   /*0x44*/ 0, 0xab /*kp-+*/, 0, 0x0b /*clear*/,
    /*0x48*/ 0, 0, 0, 0xaf /*kp-/*/,
    /*0x4C*/ 0x8d /*kp-enter*/, 0, 0xad /*kp--*/, 0,
  
***************
*** 8456,8466 ****
    /*0x60*/ 0xc2 /*f5*/, 0xc3 /*f6*/, 0xc4 /*f7*/, 0xc0 /*f3*/,
    /*0x64*/ 0xc5 /*f8*/, 0xc6 /*f9*/, 0, 0xc8 /*f11*/,
    /*0x68*/ 0, 0xca /*f13*/, 0, 0xcb /*f14*/,
!   /*0x6C*/ 0, 0xc7 /*f10*/, 0, 0xc9 /*f12*/,
  
!   /*0x70*/ 0, 0xcc /*f15*/, 0x9e /*insert (or 0x6a==help)*/, 0x95 /*home*/,
!   /*0x74*/ 0x9a /*pgup*/, 0x9f /*delete*/, 0xc1 /*f4*/, 0x9c /*end*/,
!   /*0x78*/ 0xbf /*f2*/, 0x9b /*pgdown*/, 0xbe /*f1*/, 0x51 /*left*/,
    /*0x7C*/ 0x53 /*right*/, 0x54 /*down*/, 0x52 /*up*/, 0
  };
  
--- 8460,8470 ----
    /*0x60*/ 0xc2 /*f5*/, 0xc3 /*f6*/, 0xc4 /*f7*/, 0xc0 /*f3*/,
    /*0x64*/ 0xc5 /*f8*/, 0xc6 /*f9*/, 0, 0xc8 /*f11*/,
    /*0x68*/ 0, 0xca /*f13*/, 0, 0xcb /*f14*/,
!   /*0x6C*/ 0, 0xc7 /*f10*/, 0x0a /*fn+enter on laptops*/, 0xc9 /*f12*/,
  
!   /*0x70*/ 0, 0xcc /*f15*/, 0x6a /*help*/, 0x50 /*home*/,
!   /*0x74*/ 0x55 /*pgup*/, 0xff /*delete*/, 0xc1 /*f4*/, 0x57 /*end*/,
!   /*0x78*/ 0xbf /*f2*/, 0x56 /*pgdown*/, 0xbe /*f1*/, 0x51 /*left*/,
    /*0x7C*/ 0x53 /*right*/, 0x54 /*down*/, 0x52 /*up*/, 0
  };
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]