From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Xah Lee Newsgroups: gmane.emacs.help Subject: Re: How can I change the keys? Date: Fri, 11 Apr 2008 12:50:56 -0700 (PDT) Organization: http://groups.google.com Message-ID: <6408dc50-1810-4bc1-b145-bc4b3e6fce84@n1g2000prb.googlegroups.com> References: <5065460c-b475-4934-838e-f6c9bf5f9189@a23g2000hsc.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1207946443 8502 80.91.229.12 (11 Apr 2008 20:40:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2008 20:40:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 11 22:41:16 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JkQ3b-0000IS-E8 for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Apr 2008 22:41:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JkQ2x-0007yy-N7 for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Apr 2008 16:40:31 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!n1g2000prb.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 120 Original-NNTP-Posting-Host: 24.6.97.120 Original-X-Trace: posting.google.com 1207943456 17180 127.0.0.1 (11 Apr 2008 19:50:56 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 11 Apr 2008 19:50:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: n1g2000prb.googlegroups.com; posting-host=24.6.97.120; posting-account=qPxGtQkAAADb6PWdLGiWVucht1ZDR6fn User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_4_11; en) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13, gzip(gfe), gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:157882 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53250 Archived-At: Cesar_BCN wrote: =C2=ABI'm trying to change the first keys row functionality. I want to press a key (for instance: the '8' key) and emacs writte the symbol that result of typing Shift+key (for instance: the '(' symbol ).=C2=BB I tried this for a few weeks sometimes in 2007 and find it not satisfactory, partly because in other apps you then have to switch your mental mode. A solution is to do it system-wide, but then when you use other computers (library, coworker, etc), its still a problem. Also, system-wide keymap change using default system technology do not work satisfactorily under OSX for some technical complication reasons. Namely, it is not possible to change certain basic keymaps. (in OS X for example, certain key combination event is not seen by the system, but other even/system take precedence) (For technical detail, see bottom of: =E2=80=9CMac OS X Keybinding and Unicode Tips=E2=80=9D at http://xahlee.or= g/emacs/osx_keybinding.html ) A solution is to use 3rd-party software that actually modify the OS core in some way. I haven't tried to do extensive keymapping under unix (xmodmap) or Windows, but i'm pretty sure the situation is similar. ------------------- But to do what you want, see: How to Define Keyboard Shortcuts in Emacs http://xahlee.org/emacs/keyboard_shortcuts.html basically like this: (global-set-key (kbd "1") (lambda () (insert "!"))) ... (global-set-key (kbd "") (lambda () (insert "1"))) ... again there are complications. Some mode will actually not respect it. (a solution is either to modify each mode's keymap or use some other complicated elisp mechanism to rebind or swap keys) Also, NeXT Emacs (aka =E2=80=9CEmacs.app=E2=80=9D) on the Mac has a bug that it doesn't suppo= rt any keybindings using the numerical keypad. In summary, my experiences is that when you modify keybinding in some unusual way (such as in your case), you run into other misc problems, limitations, complications,... so at the end i find it not worthwhile. Another suggestion is to type numbers by turning the keys under your right hand into a keypad, with a modifier down. (similar to notebook computer keyboards) I've tried this scheme by using Ctrl+Shift as the modifier key... but again after a few weeks didn't find this satisfactory. --------------------- Personally, regardless of typing in emacs or elsewhere, i've developed a habit in the past maybe 4 years to always type the num keys using the top row (as opposed to the keypad). The keypad i used as special buttons bind to emacs functions. (i.e. like giving you extra 10 or so function keys) To insert any matching pairs such as (), [], {}, =E2=80=9C=E2=80=9D,=C2=AB= =C2=BB,=E3=80=8C=E3=80=8Detc, i've bound them to hyper key with keys right under my right hand's home row. (and cursor movement keys are similar but bound to meta) Example: ;; make cursor movement keys under right hand's home-row. (global-set-key (kbd "M-j") 'backward-char) ; was indent-new-comment- line (global-set-key (kbd "M-l") 'forward-char) ; was downcase-word (global-set-key (kbd "M-i") 'previous-line) ; was tab-to-tab-stop (global-set-key (kbd "M-k") 'next-line) ; was kill-sentence (global-set-key (kbd "M-SPC") 'set-mark-command) ; was just-one-space ;; type parens in pairs with Hyper and right hands's home-row (global-set-key (kbd "H-j") (lambda () (interactive) (insert "{}") (backward-char 1))) (global-set-key (kbd "H-k") (lambda () (interactive) (insert "()") (backward-char 1))) (global-set-key (kbd "H-l") (lambda () (interactive) (insert "[]") (backward-char 1))) Also, i've using dvorak since about 1993. Also, my emacs shortcuts set is extensively modified. See: A Ergonomic Keyboard Shortcut Layout For Emacs http://xahlee.org/emacs/ergonomic_emacs_keybinding.html Xah xah@xahlee.org =E2=88=91 http://xahlee.org/ =E2=98=84 On Apr 10, 3:15 pm, Cesar_BCN wrote: > Hello > > I'm trying to change the first keys row functionality. I want to press > a key (for instance: the '8' key) and emacs writte the symbol that > result of typing Shift+key (for instance: the '(' symbol ). > > But I want to be able to writte numbers with the numeric keyboard. > > To the moment I have not esitate so when I change the key '8' (for > instance) the other '8' key (from the numeric keyboard) is changed > too. > > Does someone of you have the answer? > > Thanks so much. > > C=C3=A9sar BCN > cesarTMP (AT) gmail (DOT) com