On Jan 4, 1:05 pm, Martin Drautzburg <Martin.Drautzb....DeleteThis@web.de> wrote:
> Hello all
>
> I just got very confused when I tried to swap the "cmd" and "alt" keys
> on my nice (German) aluminum apple keyboard, running against Debian
> Linux.
>
> I basically understand the concept of xmodmap, and when I look at the
> events with xev everything behaves as expected. But what is really
> confusing is that the behavior is not consistent within KDE nor is it
> within emacs.
>
> Within KDE I have to uncheck "Enable keyboard layouts" and then I can
> get a backslash with the cmd key as expected. However when this option
> is checked the changes do xmodmap don't seem to have any effect. I
> don't understand how this is possible. Does KDE read raw keycodes and
> maps them to keysyms itself? And then I wonder *WHY* KDE would do such
> a thing rather than modifying xmodmap?
>
> Within emacs things are even weirder. The blackslash symbol is on the
> ssharp key on a german keyboard. After the remapping it complains about
> s-<ssharp> not being defined (substitute <ssharp> by an ssharp
> character). So emacs seems to use yet another way of processing
> keyboard events. This is with the latest emacs-snapshot (which finally
> adds support for anti-aliased fonts and looks really nice BTW)
>
> Could someone shed some light on this? Do we really have 3 (or more)
> ways to process keyboard events on a unix sytem? Should we maybe rename
> unix back to multics?
i think your general question is about how linux handle key inputs
among OS and app and emacs or their relation, or whether they all use
xmodmap ... as far as i know xmodmap is only usedin x11. e.g. if you
set your OS to not start x11, xmodmap is not used. Similarly, emacs
can be compiled without x11, so it can also bypass xmodmap...
how emacs handle key inputs is rather very complex... there's always
the full doc:
• Keymaps - GNU Emacs Lisp Reference Manual
http://xahlee.org/elisp/Keymaps.html
Note that apple kbd's Cmd key is just the Windows key.
you might also see:
• Difference Between Apple and PC keyboards
http://xahlee.org/emacs/apple_pc_kb_diff.html
if all you really want is to have the Cmd key function as emacs Meta,
it's pretty trivial. You probably tripped on something and thought too
much. I'm guessing it's probably a GUI checbox click in KDE to switch
any of the cap lock, Alt, Ctrl, Window (your Cmd), keys.
X11 has lots of legacy problems, i wouldn't surprised KDE bypass it.
• The X-Windows Disaster
http://xahlee.org/UnixResource_dir/_/The_X-Windows_Disaster.html
if you can phrase the qusetion into one very specific question perhaps
about a particular emacs key, perhaps me or other can offer more
useful help.
Xah
∑
http://xahlee.org/
☄