Welcome to Soft32 Linux Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How are keyboard events processed?

 
   Soft32 Home -> Linux -> X Window System RSS
Next:  LONG [News Digest] Mark Kent Linux News Digest fo..  
Author Message
Martin Drautzburg

External


Since: Jan 04, 2009
Posts: 1



(Msg. 1) Posted: Sun Jan 04, 2009 5:20 pm
Post subject: How are keyboard events processed?
Archived from groups: comp>emacs, others (more info?)

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?
Back to top
Login to vote
Xah Lee

External


Since: Jan 06, 2009
Posts: 1



(Msg. 2) Posted: Tue Jan 06, 2009 4:12 am
Post subject: Re: How are keyboard events processed? [Login to view extended thread Info.]
Archived from groups: comp>os>linux>x, others (more info?)

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/

Back to top
Login to vote
Display posts from previous:   
Related Topics:
Your mail could not be processed and has been blocked - Your mail " Criminal " could not be processed and has been blocked -- To UNSUBSCRIBE, email to..

PureMessage has processed a suspicious mail[Scanned] - A mail sent by you has been identified as suspicious by PureMessage. Event: Infection Action: No action Message...

[KBUILD] I don't want initramfs in 2.6.19.1 but usr/ is st.. - Hi all :) I've noticed that, even if I say NO to initramfs (and even ramdisk support), the make process wants to..

(forw) Processed: Fixed in NMU of oops 1.5.23.cvs-2.1 - Processing commands for control@bugs.debian.org: > tag 231924 + fixed >Bug#231924: oops_1.5.23.cvs-1(ia64/unstab...

Wrongly processed links on mailing list archive search res.. - Hello, the lists.debian.org mailing list archives search processes the links to the results in a wrong way. I think....

"Upcoming" events - When I visit http://www.debian.org/events/, I get: Upcoming Events with Debian Involvement Events in 2004 [November..
       Soft32 Home -> Linux -> X Window System All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Categories:
 Windows
  Linux
 Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]