LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-08-2005, 02:01 PM   #1
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Rep: Reputation: 32
Question Keyboard Remapping under KDE


Hi folks!

I have a US keyboard with a key "\" and its shifted brother "|", which is keycode 86, but when I press this thing I get < and >... How can I remap this key definitively (for konsole and applications, e.g. Kile, because I am getting tired of using copy-paste to get a backslash!)...?!

That's all folks!
 
Old 10-08-2005, 04:10 PM   #2
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Original Poster
Rep: Reputation: 32
Well, I have tried following:

1) customise /usr/share/kbd/keymaps/i386/qwerty/us.map.gz in some us.nec.map.gz document, where I have altered the entries for my keycode 86. the new file also has to have the new name in the first line!
2) alter the keytable link in /etc/sysconfig/keyboard to KEYTABLE="us.nec.map.gz"
3) run SuSEconfig in superuser mode
4) reboot

Then, when booting (both startup and shutdown) in the textmode I pressed that key and voilą it was fixed!


BUT: when KDE was up and running, the new configuration was gone! In either console or in some applications the old configuration was back. So, somehow KDE does not use that file (which some of you probably know) and overrides its own settings, probably given by YaST, which is an international US 104 generic keyboard.

I have found following: http://www-uxsup.csx.cam.ac.uk/pub/d.../ch09s03.html, which might have the solution to my problem, but I don't know what to do now. However, some of the files mentioned there are not on my system (e.g. /etc/skel/.less and /etc/skel/.lesskey). I am not an expert, just some below-average user, and that is about what I can make of it... Hopefully, YOU can help me with this... There must be a solution!

 
Old 10-08-2005, 05:18 PM   #3
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
Never had an issue like this but from what I have read you might try this. You need to the keysym value for both instead of keycode. Info can be gotten from the xev command.

use a command like this: Replace <value> with the hex value
xmodmap -e "keysym <value> = backslash"
xmodmap -e "keysym <value> = bar"

Example: Probalby will not match yours
xmodmap -e "keysym 0x5c = backslash"

If that works then you can put the lines in /etc/X11/Xmodmap like this:
keysym 0x5c = backslash

So as not to reboot one can run the command ' xmodmap /etc/X11/Xmodmap '.

If this helps please post what you did for others to learn from.
Hope this helps.
Brian1
 
Old 10-09-2005, 12:26 PM   #4
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Original Poster
Rep: Reputation: 32
Well, I have done and seen this:

On startup the system takes its own settings (which are wrong) until it loads the keymap, which is logical. However, they are wrong again, when the GUI-login panel appears.

What helps (temporarily) in KDE in the console is the command:

Code:
# xmodmap -e 'keycode 86 = backslash bar'
where "backslash bar" means that it is backslash normally and the bar when combined with shift.

Then I can use the keys as they should be...

The same can be accomplished when I add the line

Code:
keycode 86 = backslash bar
to the document /usr/X11R6/lib/X11/Xmodmap (as last line) in superuser mode, save it and then run the command:

Code:
xmodmap /usr/X11R6/lib/X11/Xmodmap
At that time I got really , but then I rebooted my laptop and then everything went as before, except that at the GUI-login the key was okay! But then, I tried some applications and the console and everything was wrong again...

However, it can easily be fixed by running xmodmap again, but I do not intend to do it everytime I start up my machine. Has someone got a solution to the problem? Is it a SuSE issue or something related to KDE? Now the problem has shifted to after the login screen has passed - there KDE must load something different to what I want it to load, problably YaST us 104 generic keyboard settings?!

Hopefully, someone knows the answer... until then I will
 
Old 10-09-2005, 12:44 PM   #5
unihiekka
Member
 
Registered: Aug 2005
Distribution: SuSE Linux / Scientific Linux / [K|X]ubuntu
Posts: 273

Original Poster
Rep: Reputation: 32
Yeah, a bash script with a link on the desktop could do the trick, I think, should no one know a good solution... I just have to click on it, when I REALLY need my backslash...

Code:
#!/bin/bash
#KeYFiX for NEC Versa P520
xmodmap /usr/X11R6/lib/X11/Xmodmap
echo "KeYFiX: Xmodmap loaded"
exit
#EOF
Of course, then the file Xmodmap has to be altered and not been chosen for the session-temporary solution of a single command!

You can see your Xmodmap file by

Code:
xmodmap -pke
 
Old 10-09-2005, 06:01 PM   #6
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 65
I didn't know how to handle both the single key press and a shift key and key press. Glad to know and will make a note of that.

I do not know the Suse distro structure or how X is compiled for Suse and it is pathing but is there not a file and directory /etc/X11 and /etc/X11/Xmodmap?
If /etc/X11 exist and no Xmodmap then Copy it over to there and try it.

Also you can have it in your home directory and have just the extra stuff you need in it only. I do not know what to exaclty name it. I have seen to name it xmodmap ,.xmodmap, Xmodmap, or as .Xmodmap. Not sure if all or certain ones are correct.
keycode 86 = backslash bar

If in the console it fails then add the xmodmap command to your ~/.bashrc.
xmodmap /usr/X11R6/lib/X11/Xmodmap

Thanks for the info there and hope this helps you out.
Brian1
 
  


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 Keyboard Shortcuts with different Keyboard Layout hellblade Linux - Software 5 04-18-2006 01:40 AM
HELP!!! Installed kde 3392 rpms keyboard dead inside kde, working in shell hansschmucker SUSE / openSUSE 1 02-13-2005 09:01 PM
keyboard remapping bicolano53 Linux - Newbie 1 09-21-2004 10:03 PM
Remapping keys - is it possible? LooseCanon Linux - General 2 09-03-2003 11:36 PM
Keysym remapping - keyboard shortuts in a shell: how to define modifiers? larus_marinus Linux - General 0 07-03-2003 10:52 AM

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

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