LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 09-03-2009, 01:54 PM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Rep: Reputation: 110Reputation: 110
Help with custom keyboard layout


Hi. I have a new Acer D150 running Ubuntu Jaunty. It's regular Ubuntu, not any "remix" or "netbook" edition. The machine is great, but I hate the keyboard. I've spent a lot of time trying to customize its layout, but I can't really make heads and tails of the configuration files. It seems that changing alphanumeric keys is very easy, but I rather need to change two special keys, and what with so many layouts and subsections being chained into each possible layout with an "include" command, I always get lost on that maze. I wonder if someone here can help me.

Here is a pretty good shot of the keyboard. I only want to change two keys so far: the first one right next to AltGr (I don't even know what to call it) should be Backspace, and the right-hand Control key should be Delete.

Can someone please give me clear instructions on how to achieve that?

Thank you for any help.
 
Old 09-03-2009, 06:00 PM   #2
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
If you open a terminal and enter the command
setxkbmap -print
you'll get a list of the files used to compile your keyboard driver. I get

xkb_keymap {
xkb_keycodes { include "evdev+aliases(qwerty)" };
xkb_types { include "complete+caps(internal_nocancel)" };
xkb_compat { include "complete+ledscroll(group_lock)" };
xkb_symbols { include "pc+gb+inet(evdev)+altwin(meta_alt)+group(shift_caps_toggle)+level3(win_switch)+compose(menu)" };
xkb_geometry { include "pc(pc105)" };
};

You'll find these files in /usr/share/X11/xkb (ro perhaps /etc/X11/xkb) and you can do anything by altering them: keep copies of the originals inst in case of mistakes! To make the two changes you mention, alter .../symbols/pc, or just add the new lines to your national driver ("gb" in my case), as that overrides the others.

The "pc" file will include the lines

key <MENU> { [ Menu ] };
key <RCTL> { [ Control_R ] };

What you want, here or in your national file, is
key <MEMU> { [ BackSpace ] };
key <RCTL> { [ Delete ] };
 
Old 09-04-2009, 11:11 AM   #3
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Thanks, David! That is really nice.

However, <MENU> = BackSpace isn't working. That key still performs the original funcion. Only <RCTL> = Delete is working. Of course, I corrected your obvious typo: s/MEMU/MENU. Do you have any idea why it isn't working?

Oh, one more thing: <RCTL> deletes, but I can't hold it and delete lots of characters in a row like with the Delete key. I have to press it once for each character. Not a big deal, but I wish I could fix that too.

Last edited by lucmove; 09-04-2009 at 11:14 AM.
 
Old 09-06-2009, 06:15 PM   #4
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Two days and a reboot later, <MENU> = BackSpace is working too. Go figure. The only side effect still on is that Ctrl-Alt-Del does not work anymore. It doesn't matter whether I use the original Delete key (which I didn't change) or the new emulated Delete key. But I can live with that. Thank you again!
 
Old 09-07-2009, 12:25 PM   #5
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,142

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
The reset command is actually Ctrl-Alt-Backspace, not Ctrl-Alt-Delete. In the …/symbols/pc file you should have

key <BKSP> {
type="CTRL+ALT",
symbols[Group1]= [ BackSpace, Terminate_Server ]
};

You could, if you preferred, have

key <MENU> {
type="CTRL+ALT",
symbols[Group1]= [ BackSpace, Terminate_Server ]
};

or even

key <RCTL> {
type="CTRL+ALT",
symbols[Group1]= [ Delete, Terminate_Server ]
};

In Linux, almost anything is possible
 
Old 09-07-2009, 01:42 PM   #6
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Ctrl-Alt-Backspace kills X (except on Ubuntu, where it's disabled), it's not the same as Ctrl-Alt-Del. In KDE, Ctrl-Alt-Del calls a Logout/Restart/Shutdown dialog, which I remapped to something else, so everything is OK.

I just discovered that I need the menu key for some Konqueror right-click command that I use a lot. Humm... Maybe I can map it to the old Delete key at the top of the layout. Notebooks have such lame layouts... :-\
 
Old 09-07-2009, 02:19 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by lucmove View Post
Ctrl-Alt-Backspace kills X (except on Ubuntu, where it's disabled)
Ctrl-Alt-Backspace kills X on ubuntu 8.04. Maybe it's a kubuntu thing. BTW, why did you switch from Slackware to kubuntu?
 
Old 09-07-2009, 03:01 PM   #8
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian
Posts: 1,432

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
Originally Posted by catkin View Post
BTW, why did you switch from Slackware to kubuntu?
- Automatic dependency resolution. No more hunting endless dependencies (try installing mplayer on Slackware) or symlinking libraries to make stuff work. Except VMWare. Always VMWare...

- Bluetooth system that actually works (at least it did on Hardy).

- Integrated wifi drivers and application to choose an access point and connect. That was a major headache on Slackware. Plus, Slackware kept dropping my wifi connection all the time. No one ever gave me a solution to that problem. I see that it happens on Ubuntu too, but Ubuntu reconnects automatically. Something sucks in the wifi implementation in Linux and Ubuntu seems more aware of it.

Low-level system tweaking is a lot better on Slackware, but it turns out I rarely ever find myself tweaking anything on Ubuntu. Ubuntu works out of the box. I had fun exploring and tweaking Slackware, but I don't find that fun anymore. I want something that works right away.
 
  


Reply



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
custom forum layout / ignore some forums or sort them ? H_TeXMeX_H LQ Suggestions & Feedback 11 05-31-2009 01:43 PM
problem creating custom xkb layout drobert Linux - Desktop 3 06-28-2008 08:21 PM
Switching keyboard layout - Mandriva2006 - K.D.E. Windows Layout! itz2000 Mandriva 3 08-13-2006 06:43 PM
KDE Keyboard Shortcuts with different Keyboard Layout hellblade Linux - Software 5 04-18-2006 12:40 AM
Keyboard layout Nylex Slackware 2 08-08-2003 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:15 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