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 - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-27-2010, 11:39 PM   #1
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Rep: Reputation: 107Reputation: 107
down arrow key somehow mismapped or something


Weird problem I've been having in Linux. Whenever I press the down arrow, instead of doing the regular key down thing, it either deletes text or backs up in what I've been typing, I'm not totally clear on the pattern. When I'm not typing (paging down through something in nano, for example), it doesn't seem to do anything.

But when I load up my XP virtual machine and try typing in that, it goes down just like it should, so its only happening in Linux, and not as a problem with my keyboard.

I use a laptop, but the problem happens both with the laptop's keyboard and the regular wireless keyboard I use.

Rebooting doesn't fix it, and I have no idea at all on how to fix this.
 
Old 11-28-2010, 12:49 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
It sounds like you may have the wrong keyboard mapped in your /etc/X11/xorg.conf file. Win would have its own mapping, so if it is set up correctly, that could explain the wrong behavior in linux.

Have a look at /etc/X11.xorg.conf. It will look something like this:

Quote:
Section "InputDevice"
# generated from data in "/etc/sysconfig/keyboard"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
The XkbModel field should match the number of keys on the keyboard. I have had to count them to make sure. Mine is full size keyboard; so 105 keys is correct for mine.

Hope this helps.
 
Old 11-28-2010, 07:24 AM   #3
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Original Poster
Rep: Reputation: 107Reputation: 107
Code:
Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection
Should any of that be changed?
I counted 111 keys, including the fn key, context menu key, and windows key

Last edited by Cultist; 11-28-2010 at 07:27 AM.
 
Old 11-28-2010, 11:44 AM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
If you have 111 key buttons, then yes, there this should be updated. I don't see anything there to identify the keyboard.

Since I don't have your keyboard, I can not tell you exactly what to enter as options. Note what I have... The country is identified, and the number of keys. I think that is what you will need to enter. Give it a go, after you update the file you need to restart the desktop. Ctrl + Alt + backspace does the trick on most systems. If not, log out, then back in and test it.
 
Old 11-28-2010, 12:42 PM   #5
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Original Poster
Rep: Reputation: 107Reputation: 107
Tried adding those last two lines with both 105 and 111, still the same. Tried pressing down with shift, ctrl, alt, or fn makes it do nothing at all, not even the weird deleting thing.

So I have no idea whats up. It worked fine before, not sure exactly when it happened, sometime yesterday I noticed it.
 
Old 11-28-2010, 12:55 PM   #6
2ck
Member
 
Registered: Mar 2010
Location: /home/twock
Distribution: Debian
Posts: 74
Blog Entries: 9

Rep: Reputation: 21
I always recommend starting X without an xorg.conf, and if your keyboard works, then just go from there.
 
Old 11-30-2010, 05:49 PM   #7
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Original Poster
Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by 2ck View Post
I always recommend starting X without an xorg.conf, and if your keyboard works, then just go from there.
How do I do this?

And what will it affect on my system?
 
Old 12-01-2010, 09:18 AM   #8
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
As root, do a 'cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup' and then do a 'rm /etc/X11/xorg.conf'. That will give you a backup of the original, and erase the original. You can always copy it back, if you still want it.

Then restart the system.

What effect, you won't know for sure until you give it a go.
 
1 members found this post helpful.
Old 12-01-2010, 01:12 PM   #9
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
Or mv /etc/X11/xorg.conf /etc/X11/xorg.conf.backup which is less work and has the advantage of preserving timestamps etc.
 
Old 12-04-2010, 08:45 PM   #10
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Original Poster
Rep: Reputation: 107Reputation: 107
removing xorg.conf didn't help. Any other thoughts on what the problem could be?
 
Old 12-05-2010, 05:55 AM   #11
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,215

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
Some thoughts. Is this a branded keyboard, such as Logitech? If so, could you post what you know about it.

111 key keyboards are not at all common, at least not in my area of the world.

Basically, any keyboard generates scan codes as the keys are pressed. The scan codes are passed to the Xserver, or terminal, and converted there to a character, or action.

I did some googling, and found this. -->http://www.linuxscrew.com/2008/09/15...-key-in-linux/

It shows you how to disable, or remap a key in linux. There is a man page for xmodmap, the command for remapping keys.

Since the keys work in XP, then there is a correct map for this keyboard. It is possible you do not have the correct map installed in linux. ( Slackware ? ) If this is an international keyboard, then you might have a look for a package(s) for international keyboard. Not sure there, but it would be worth a look.

I also found this link -->https://wiki.archlinux.org/index.php...cific_Keyboard

It shows you how to configure a keyboard form scratch. It shows you how to find the scan code for each button. I would not go this way, unless all else fails.

Hope this helps.

Last edited by camorri; 12-05-2010 at 06:05 AM.
 
Old 12-05-2010, 08:30 AM   #12
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
If changing the layout won't help, try this:

Launch "xev" from a terminal, and make sure the window that appears is focused. Then press the down key and write down the keycode (shown in the terminal).

Then, add this line to your ~/.Xmodmap file (create one of you don't have it), and replace "###" with the keycode you noted:

Code:
keycode ### = Down
Finally, add this line to your ~/.xinitrc

Code:
xmodmap ~/.Xmodmap
I DON'T KNOW IF THIS WILL WORK IF YOU USE A LOGIN MANAGER, JUST A SUGGESTION.
 
Old 12-08-2010, 06:07 PM   #13
Cultist
Member
 
Registered: Feb 2010
Location: Georgia
Distribution: Slackware64 14.2
Posts: 779

Original Poster
Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by MTK358 View Post
If changing the layout won't help, try this:

Launch "xev" from a terminal, and make sure the window that appears is focused. Then press the down key and write down the keycode (shown in the terminal).

Then, add this line to your ~/.Xmodmap file (create one of you don't have it), and replace "###" with the keycode you noted:

Code:
keycode ### = Down
Finally, add this line to your ~/.xinitrc

Code:
xmodmap ~/.Xmodmap
I DON'T KNOW IF THIS WILL WORK IF YOU USE A LOGIN MANAGER, JUST A SUGGESTION.
The key was 116, and when I opened xmodmap, that key was set to rightwin, for some reason (keyboard doesn't even have a right window key). But changing it from that to Down fixed it! Thank you so much
 
Old 12-08-2010, 07:02 PM   #14
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 Cultist View Post
The key was 116, and when I opened xmodmap, that key was set to rightwin, for some reason (keyboard doesn't even have a right window key). But changing it from that to Down fixed it! Thank you so much
Good!

Now you can mark the thread as solved.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recognizing up arrow key in C programs leonardo6023 Programming 3 08-19-2009 08:24 AM
Arrow keys mismapped on Suse 11.1 and Logitech "Cordless Desktop Pro" keyboard? brianpbarnes Linux - Software 1 05-02-2009 02:57 PM
Tab Key and arrow key zillah Solaris / OpenSolaris 12 05-26-2005 02:51 PM
Arrow Key mapping lazlom AIX 5 06-21-2004 03:32 PM
down arrow key problem rcbob Linux - Software 0 06-05-2004 07:58 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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