Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapping dead keys like "^"

I'm currently rebinding almost all of my Emacs bindings to fit my new keyboard layout, bépo, a french equivalent of dvorak.

I'm having trouble mapping my ^ key. The ^ key is a dead key but not at a material level.

I'd like to be able to to map C-^ but currently, it don't work. Because "dead-circumflex" and "circumflex" are two different keys.

If I do:

(global-set-key "C-^" 'next-line)

Then, pressing control key with "^" key does the following:

 <C-dead-circumflex> is undefined

We have the proof emacs see the dead-circumflex. But I still can't manage to map it.

I know that I can do

(global-set-key "^" 'next-line)

, and that it will work by pressing ^ twice, but it's not the workaround I'm searching for.

like image 601
lots_of_birds Avatar asked Feb 05 '12 00:02

lots_of_birds


People also ask

What is meant by a dead key?

A dead key is a special kind of modifier key on a mechanical typewriter, or computer keyboard, that is typically used to attach a specific diacritic to a base letter. The dead key does not generate a (complete) character by itself, but modifies the character generated by the key struck immediately after.

What is US International with dead keys?

The US-International keyboard uses the ', `, ~, ^, " as dead keys (highlighted in blue below), and uses Right-ALT plus !, ?, and a number of other keys to produce characters not normally available.


1 Answers

The error message tells you what name Emacs uses for the key. You can pass that string to the kbd function to bind it.

(global-set-key (kbd "<C-dead-circumflex>") 'next-line)
like image 185
Porculus Avatar answered Oct 26 '22 21:10

Porculus