LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 03-09-2009, 11:38 AM   #1
phugoid
LQ Newbie
 
Registered: Mar 2006
Location: Dubai, United Arab Emirates
Distribution: Suse 10.0
Posts: 14

Rep: Reputation: 0
Ctrl-w maybe intercepted by KDE, need it for emacs


I just noticed that the combination Ctrl-w is not triggering "kill-region" in emacs as expected. This is true if I open "emacs -nw" in Konsole, in Eterm, or if I allow it to open its own GUI window. I'm running Mandriva One 2009 with KDE 4.1.

If I bring up the list of all key-bindings in emacs (Ctrl-h b), C-w is indeed listed as bound to kill-region. But if I do Ctrl-h Ctrl-w to get help for a key combination, emacs doesn't receive the sequence. That last bit works fine for other sequences.

If I try it in a virtual console (Ctrl-Alt-F3), the Ctrl-w key binding works fine in emacs.

If I open kcontrol (from command line, it's unavailable in Mandriva menus), and check Regional&Accessibility, nothing seems to be amiss.

There is a big difference between the xev outputs generated by Ctrl-y and Ctrl-w, as below:

Ctrl-y, works fine
Code:
KeyPress event, serial 34, synthetic NO, window 0x3e00001,
    root 0x2ed, subw 0x0, time 1176552699, (66,571), root:(721,594),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:                                       
    XmbLookupString gives 0 bytes:                                     
    XFilterEvent returns: False                                        

KeyPress event, serial 34, synthetic NO, window 0x3e00001,
    root 0x2ed, subw 0x0, time 1176553056, (66,571), root:(721,594),
    state 0x14, keycode 29 (keysym 0x79, y), same_screen YES,       
    XLookupString gives 1 bytes: (19) ""                            
    XmbLookupString gives 1 bytes: (19) ""                          
    XFilterEvent returns: False                                     

KeyRelease event, serial 34, synthetic NO, window 0x3e00001,
    root 0x2ed, subw 0x0, time 1176553149, (66,571), root:(721,594),
    state 0x14, keycode 29 (keysym 0x79, y), same_screen YES,       
    XLookupString gives 1 bytes: (19) ""                            
    XFilterEvent returns: False                                     

KeyRelease event, serial 34, synthetic NO, window 0x3e00001,
    root 0x2ed, subw 0x0, time 1176554134, (66,571), root:(721,594),
    state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
Ctrl-w, intercepted
Code:
KeyPress event, serial 34, synthetic NO, window 0x4000001,
    root 0x2ed, subw 0x0, time 1176787194, (165,-11), root:(820,12),
    state 0x10, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

FocusOut event, serial 34, synthetic NO, window 0x4000001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 34, synthetic NO, window 0x4000001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 34, synthetic NO, window 0x0,
    keys:  4294967277 0   0   2   32  0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

KeyRelease event, serial 34, synthetic NO, window 0x4000001,
    root 0x2ed, subw 0x0, time 1176787466, (165,-11), root:(820,12),
    state 0x14, keycode 25 (keysym 0x77, w), same_screen YES,
    XLookupString gives 1 bytes: (17) ""
    XFilterEvent returns: False

KeyRelease event, serial 34, synthetic NO, window 0x4000001,
    root 0x2ed, subw 0x0, time 1176787735, (165,-11), root:(820,12),
    state 0x14, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
I'm not sure what that means or where to look next. I would like to prevent Ctrl-w from being intercepted so that I can use it in emacs.
I'd be very grateful if you could point me in the right direction.
 
Old 04-06-2009, 09:58 AM   #2
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,795

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by phugoid View Post
I just noticed that the combination Ctrl-w is not triggering "kill-region" in emacs as expected. This is true if I open "emacs -nw" in Konsole, in Eterm, or if I allow it to open its own GUI window. I'm running Mandriva One 2009 with KDE 4.1.

If I bring up the list of all key-bindings in emacs (Ctrl-h b), C-w is indeed listed as bound to kill-region. But if I do Ctrl-h Ctrl-w to get help for a key combination, emacs doesn't receive the sequence. That last bit works fine for other sequences.

If I try it in a virtual console (Ctrl-Alt-F3), the Ctrl-w key binding works fine in emacs.

(snip)

I'm not sure what that means or where to look next. I would like to prevent Ctrl-w from being intercepted so that I can use it in emacs.
I'd be very grateful if you could point me in the right direction.
As a fellow Emacs devotee, I can feel your pain. I'm strongly suspect that this is a KDE problem. Especially since you don't encouter the problem when running emacs in a non-GUI console. I'm using a Gnome desktop and do not see this problem. I get the same results from xev that you're seeing. BTW, it's not the first complaint I've heard from long-time Linux users about the way keyboard shortcuts from way back have been getting slowly replaced by the KDE team with something more Windows compatible. (If the KDE developers are so gung ho about making a Windows clone, why not give users a configuration setting to allow the use of traditional UNIX keymappings or the Windows variety?) One recent post on another website was complaining about how KDE had redefined many of the Emacs command line editting commands (Ctrl-A, Ctrl-E, Ctrl-W, etc.) that have been part of UNIX/Linux for years. I'm guessing that you might also have trouble running a search in Emacs (Ctrl-S) as well. I can remember the times when I had trouble telnetting to a UNIX system and trying to run Emacs in a DOS window since Windows was insisting on trapping all of the keys. I couldn't save a file. Heck the only UNIX editor that was safe to use was "ed". (Luckily Cygwin saved the day.) Sounds like KDE is emulating Windows a bit too closely.

One possible solution to your dilemma: Unless there's a show-stopping reason, you don't have to use KDE as your desktop manager. Just load the KDE components so that you can run those KDE-based applications when you need to. The Gnome desktop hasn't mucked around with things like the key mappings so Emacs/Xemacs should run fine.

Hope this helps...

Cheers,

Rick
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
KDE 3.5.9 - Konqueror - keyboard shortcuts ctrl+, and ctrl+. sometimes stop working bhy Linux - Desktop 1 07-26-2008 11:48 AM
emacs ctrl-m is RET. how to change ? Horos23 Linux - Software 1 11-12-2007 11:53 PM
KDE: Ctrl+shift = very annoying! Spudley Linux - Software 1 04-21-2005 05:11 PM
dark screen when pressing Ctrl + Alt + Backspace or Ctrl + Alt F1-F6 in Gnome or KDE trinoo Slackware 5 01-28-2005 08:13 AM
no ctrl-a or ctrl-z in emacs or on command line? ashlock Fedora 5 12-30-2003 08:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration