LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-11-2011, 04:33 PM   #1
mesuutt
Member
 
Registered: Jan 2011
Location: İstanbul
Distribution: Slackware,Debian
Posts: 62

Rep: Reputation: 1
Question Instead of not working key to assign a different key ?


Hi friends

I have an old laptop.The laptop's 2 keys(g-h) are not working.I think the keys assign to different keys that the keys are windows keys near CTRLs because linux dont use these keys.Can I assign not working keys to the windows keys?

I hope you understand me.

Last edited by mesuutt; 05-11-2011 at 04:34 PM.
 
Old 05-11-2011, 04:59 PM   #2
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 132

Rep: Reputation: 100Reputation: 100
If you start up `xev` from a terminal window and hit a key it will tell you what the keycode is, (for example F9 gives me keycode 75). Then if you run `xmodmap -e 'keycode 75 = g G'` the letter g would be mapped to F9.

I think there might be problem with using the windows keys. You'll probably have to check the name for the key with xev (ought to be "Super_L" for the left windows key) and then run `xmodmap` to see if Super_L is assigned to any modifier (say, "mod4"). In which case you remove it with `xmodmap -e 'remove mod4 = Super_L'`.
 
Old 05-11-2011, 05:29 PM   #3
mesuutt
Member
 
Registered: Jan 2011
Location: İstanbul
Distribution: Slackware,Debian
Posts: 62

Original Poster
Rep: Reputation: 1
I tried xev(give to me 133 and 134 key codes ),after xev `xmodmap -e 'keycode 133 = g G'`,`xmodmap -e 'keycode 134 = h H'` and now it is working greet

I understand your second say that I should check if the keys already using.But I dont understand how am I check for that if the keys already using for different works?

Do you understand me?
 
Old 05-11-2011, 05:45 PM   #4
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 132

Rep: Reputation: 100Reputation: 100
Run `xmodmap` by itself and it'll print stuff like:
shift Shift_L (0x32), Shift_R (0x3e)
mod1 Alt_L...
If the name for the windows key given by xev is anywhere in the output of xmodmap you run:
xmodmap -e 'remove <modifier> = <name of key>'
where <modofier> is mod3 or something like that, and the name probably is Super_L.

But if it is working and you don't have any bad side effects I don't think it's necessary.

Also, the changes are not premanent, so you'll probably want to put the "xmodmap -e ..." stuff in a script that'll run every time X starts, xinitrc or some KDE-autostart-script.
 
Old 05-11-2011, 06:41 PM   #5
jmccue
Member
 
Registered: Nov 2008
Location: US
Distribution: slackware
Posts: 687
Blog Entries: 1

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Hi Mesuutt

see 'man loadkeys'

You can try grabbing the keyboard file being used from
dir /usr/share/kbd/keymaps, modify it and execute loadkeys
using your personal copy. You need to be root to use loadkeys,

That will also change the keys for the console

HTH
Jack
 
Old 05-12-2011, 01:47 AM   #6
mesuutt
Member
 
Registered: Jan 2011
Location: İstanbul
Distribution: Slackware,Debian
Posts: 62

Original Poster
Rep: Reputation: 1
Wink

Quote:
Originally Posted by e5150 View Post
Run `xmodmap` by itself and it'll print stuff like:
shift Shift_L (0x32), Shift_R (0x3e)
mod1 Alt_L...
If the name for the windows key given by xev is anywhere in the output of xmodmap you run:
xmodmap -e 'remove <modifier> = <name of key>'
where <modofier> is mod3 or something like that, and the name probably is Super_L.

But if it is working and you don't have any bad side effects I don't think it's necessary.

Also, the changes are not premanent, so you'll probably want to put the "xmodmap -e ..." stuff in a script that'll run every time X starts, xinitrc or some KDE-autostart-script.
I dont think the keys will occur a problem.But I understand you and I will try the keys are already using other works this evening
 
Old 05-12-2011, 01:52 AM   #7
mesuutt
Member
 
Registered: Jan 2011
Location: İstanbul
Distribution: Slackware,Debian
Posts: 62

Original Poster
Rep: Reputation: 1
Wink

Quote:
Originally Posted by jmccue View Post
Hi Mesuutt

see 'man loadkeys'

You can try grabbing the keyboard file being used from
dir /usr/share/kbd/keymaps, modify it and execute loadkeys
using your personal copy. You need to be root to use loadkeys,

That will also change the keys for the console

HTH
Jack
I thing that I dont need a personal copy of my keymaps.Because I changed only two keys.
 
Old 05-12-2011, 11:23 AM   #8
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by mesuutt View Post
linux dont use these keys.
Actually, it does.

"Linux" itself doesn't use any keys. It just depends on the applications you run. I like to use the Super (which is the real name for that key before M$ decided that it should have their logo on it) keys for launching applications and switching desktops.
 
Old 05-13-2011, 03:42 AM   #9
mesuutt
Member
 
Registered: Jan 2011
Location: İstanbul
Distribution: Slackware,Debian
Posts: 62

Original Poster
Rep: Reputation: 1
How am I do permanent change these keys? So when I reboot computer,these keys not working.Must I run `xmodmap -e 'keycode 133 = g G'`,`xmodmap -e 'keycode 134 = h H'` commands after every reboots?
 
Old 05-13-2011, 08:12 AM   #10
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Open the file ~/.Xmodmap in a text editor (create it if it's not there) and add these lines:

Code:
keycode 133 = g G
keycode 134 = h H
If you use startx, then open the file ~/.xinitrc in a text editor, and add this line:

Code:
xmodmap ~/.Xmodmap
That will cause the command to run when you start X. If you don't use startx, I don't know how to do this.
 
  


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
RHEL5 not assign a partition for usb key huntkey Linux - Newbie 6 12-17-2010 06:00 PM
How do i assign keys to adjust CRT monitor brightness w/o FN key or physical controls Pooped Linux - General 1 07-03-2009 06:12 AM
How to assign a symbol to a key Pedroski Linux - Hardware 3 05-17-2009 02:02 AM
"Enter Key" not working, how to map "Enter Key" functionality to "F9" Key srinihi Linux - Newbie 1 04-03-2009 02:46 PM
bash script Want to capture return key and assign a value procfs Programming 9 07-07-2006 01:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:45 PM.

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