all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Dyballa <Peter_Dyballa@Web.DE>
Cc: help-gnu-emacs@gnu.org
Subject: Re: emacs-snapshot keybinding problem
Date: Sat, 31 Dec 2005 18:21:01 +0100	[thread overview]
Message-ID: <9bc9d7eb4441de7f9ae098a8cf925706@Web.DE> (raw)
In-Reply-To: <87hd8p5l5p.fsf@magma.ca>


Am 31.12.2005 um 16:41 schrieb Angelina Carlton:

>> 	keycode 115 = Hyper
>> 	add Mod4 = Hyper
>> 	keycode 115 = super
>> 	add Mod5 = super
>
> Ok, for this system it complains that Hyper and super are not valid
> keysyms

Sorry! It has to be with _L or _R, and here in Mac OS X it's Super 
(with _L or _R), uppercase!

>
> So my function keys now go all the way up to F16 :-) and I have OPTL 
> set
> to Hyper_L and OPTR set to Super_R, I now need to
> learn the syntax to bind something to the Super and Hyper keys
>
> (global-set-key [(hyper q)] 'some-function) does not work.

(global-set-key [s-f1]          'replace-string)
(global-set-key [H-f]           'end-of-defun)

S- is the Shift key
C- is the Control key
M- is the Meta key
A- is the Alt key
H- is the Hyper key
s- is the super key

A simple and looong text way to find out, is to invoke global-set-key 
interactively, press the key combination, and then invoke 
repeat-complex-command, which is C-x Esc Esc or C-x M-: or C-x M-ESC. 
In minibuffer the keybinding is listed. C-a: you're at the expression's 
beginning, C-k: you've killed the expression, C-g: minibuffer closes. 
Now enter ~/.emacs and yank that line near the other global-set-key's: 
finished!

>
> Incidentally these function keys still get overwritten in emacs22, I 
> have
> not tried to address this yet because as you pointed out, my
> key mappings were incorrect to begin with, even in emacs21 so one step 
> at
> a time I suppose :)
>

You have to make a difference between GNU Emacs running inside a 
terminal (emulation), or as an X client in its own window. The keys you 
set with xmodmap do not exist in nowindows mode. XTerm and other 
terminal emulations have kind of 'text bindings' to keys, particularly 
to function keys. The syntax to set up these X resources in 
~/.Xdefaults is not easy, I presume I copied these lines from 
somewhere:

XTerm*vt220*VT100.translations: #override \n\
    ~Shift<Key>F1:       string(0x1b) string("OP") \n \
    ~Shift<Key>F2:       string(0x1b) string("OQ") \n \
    ~Shift<Key>F3:       string(0x1b) string("OR") \n \
    ~Shift<Key>F4:       string(0x1b) string("OS") \n \
    ~Shift<Key>F5:       string(0x1b) string("[16~") \n \
    ~Shift<Key>F6:       string(0x1b) string("[17~") \n \
    ~Shift<Key>F7:       string(0x1b) string("[18~") \n \
    ~Shift<Key>F8:       string(0x1b) string("[19~") \n \
    ~Shift<Key>F9:       string(0x1b) string("[20~") \n \
    ~Shift<Key>F10:      string(0x1b) string("[21~") \n \
    ~Shift<Key>F11:      string(0x1b) string("[28~") \n \
    ~Shift<Key>F12:      string(0x1b) string("[29~") \n \
     Shift<Key>F1:       string(0x1b) string("[23~") \n \
     Shift<Key>F2:       string(0x1b) string("[24~") \n \
     Shift<Key>F3:       string(0x1b) string("[25~") \n \
     Shift<Key>F4:       string(0x1b) string("[26~") \n \
     Shift<Key>F5:       string(0x1b) string("[K~")  \n \
     Shift<Key>F6:       string(0x1b) string("[31~") \n \
     Shift<Key>F7:       string(0x1b) string("[31~") \n \
     Shift<Key>F8:       string(0x1b) string("[32~") \n \
     Shift<Key>F9:       string(0x1b) string("[33~") \n \
     Shift<Key>F10:      string(0x1b) string("[34~") \n \
     Shift<Key>F11:      string(0x1b) string("[28~") \n \
     Shift<Key>F12:      string(0x1b) string("[29~") \n

!XTerm*VT100.translations: #override \
!	<Key>BackSpace:	string("\010") \n\
!   Shift<Key>Tab:	string("\033[Z") \n\
!    Ctrl<Key>minus:	string("\037") \n\
!	<Key>Home:	string("\033[1~") \n\
!	<Key>End:		string("\033[4~") \n\
!	<Key>Delete:	string("\033[3~") \n\
!   Shift<Key>Delete:	string("\177") \n\
!    Ctrl<Key>Delete:	string("\010") \n\
!     Alt<Key>Return:	string("\033\015") \n\
!     Alt<Key>space:	string("\033\040") \n

\033 is the same as 0x1b wrapped in a string() call solely. Some X 
clients understand the modifiers "Alt," "Ctrl," "Meta," or "Shift." If 
xterms does too, and maybe understands Hyper or Super too, you have the 
option to define your own extra set of key sequences these key produce 
when pressed with any of these modifiers, that should work without 
windows. In extending the xterm.el code you might get these extra 
layers.

To activate these X resources you can merge them via 'xrdb -merge < 
~/.Xdefaults'.

--
Greetings

   Pete

Well done is better than well said.
    ---- Benjamin Franklin

  reply	other threads:[~2005-12-31 17:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.20812.1135883611.20277.help-gnu-emacs@gnu.org>
2005-12-30  4:49 ` emacs-snapshot keybinding problem Stefan Monnier
2005-12-30 14:21   ` Angelina Carlton
2005-12-30 15:45     ` Peter Dyballa
2005-12-30 18:31       ` Angelina Carlton
2005-12-30 23:52         ` Peter Dyballa
2005-12-31 15:41           ` Angelina Carlton
2005-12-31 17:21             ` Peter Dyballa [this message]
2006-01-01 18:04               ` Angelina Carlton
2006-01-01 18:57                 ` Peter Dyballa
2006-01-02 20:24                   ` Angelina Carlton
2006-01-03 12:58                     ` Peter Dyballa
2006-01-03 22:49                       ` Angelina Carlton
2006-01-03 23:52                         ` Peter Dyballa
2006-01-04 21:51                           ` Angelina Carlton
2006-01-04 22:48                             ` Peter Dyballa
2006-01-06  5:08                             ` Ian Zimmerman
2006-01-06 18:17                               ` Angelina Carlton
     [not found]                           ` <mailman.21417.1136411578.20277.help-gnu-emacs@gnu.org>
2006-01-05 10:57                             ` Romain Francoise
2006-01-05 14:05                               ` Angelina Carlton
2006-01-02 16:36             ` Stefan Monnier
2006-01-04 21:43               ` Angelina Carlton
2005-12-29 19:11 Angelina Carlton

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=9bc9d7eb4441de7f9ae098a8cf925706@Web.DE \
    --to=peter_dyballa@web.de \
    --cc=help-gnu-emacs@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.