LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-16-2007, 09:54 AM   #1
ixhabbaba
Member
 
Registered: Sep 2007
Posts: 35

Rep: Reputation: 15
Problem with keymap (can't pipe)


Hello!

I'm a new user, with a keymap problem. I switched
from Ubuntu to Vector Linux two months ago, which
has worked just fine, except for one small nuisance.

When I use X (I usually use the XFCE desktop environment),
the key containing the pipe characters (less than, greater
than, and... well, pipe) doesn't work, which is annoying
to say the least. This key works fine in normal vty's,
which has led me to believe that X uses a different
keymap.

Please tell me: How do I check which keymap is used
in the vty's, and reconfigure X to use it as well?


Joel

PS: I use a Swedish keyboard,though I think it has roughly
the same layout as an American.
 
Old 09-17-2007, 02:38 PM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,644

Rep: Reputation: 145Reputation: 145
Open /etc/X11/xorg.conf. Your keyboard section should probably look like this, else modify it and restart your X server:

Code:
Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option       "XkbModel"  "pc105"
        Option       "XkbLayout"  "sv"
EndSection
EDIT: Which keyboard mapping is used in the login console is controlled by /etc/rc.d/rc.keymap in Slackware, I think it's the same in Vector Linux.

Last edited by titopoquito; 09-17-2007 at 02:39 PM. Reason: additional info
 
Old 09-17-2007, 10:10 PM   #3
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
A handy utility is 'setxkbmap'. If the keys get messed up, just say e.g. 'setkbmap us' at the command prompt for the us layout. The other relevant layouts may be 'se' for Swedish, 'uk' for UK etc.
Best, Ott
 
Old 09-19-2007, 02:32 PM   #4
ixhabbaba
Member
 
Registered: Sep 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks for the help, and sorry for the double posting
(still getting used to the forum...).

Anyways, I checked xorg.conf, and the InputDevice
section was already set to "se". Well, the Swedish
native letters work and all, so it's basically just the
piper key that keeps giving me headaches....

I've heard of people having problems with something
called "dead keys", i.e. keys like tilde, using modifiers.
Do you think this could be something like that?

PS:
I edited the rc.keymap, which was set for us keyboards.
Thanks for the tip.

PS 2:
Vector Linux doesn't seem to have setkbmap, and I can't
find it in the slapt-get repositories either. It does seem
handy, however.

Last edited by ixhabbaba; 09-19-2007 at 02:35 PM.
 
Old 09-19-2007, 11:50 PM   #5
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
It is called setxkbmap and I believe it is a standard part of X11.

Ott
 
Old 09-20-2007, 11:54 AM   #6
ixhabbaba
Member
 
Registered: Sep 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Oh, I see. I'm being stupid yet again. Sorry.
Well, I found setxkbmap, but it doesn't seem to help any.
Very strange indeed.

Do you know if XFCE overrides the keyboard layout or
something, since it doesn't seem to be X itself?
 
Old 09-20-2007, 12:15 PM   #7
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
I don't think WM-s bother to tinker with keymaps. setxkbmap works under fvwm and gnome and I believe under most of the other WMs out there. But try something really crazy, like 'setxkbmap ru' for Russian or so, and look if there is any effect...

About pipe -- I had a keyboard w/o the pipe key. Many European keyboards have <>| key next to left shift, and this key was simply missing... A strange type of keyboard... The solution was to remap the LWin key using xmodmap.

Best,
Ott
 
Old 09-20-2007, 12:29 PM   #8
ixhabbaba
Member
 
Registered: Sep 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Yeah, it had effect all right. Xterm denied input.
Had to restart the X session. Well, can't be that, then.
I checked out xmodmap, which in turn referred me to a program
called xev, which I used to check out the key in question.
The computer knows it's there, but it seems it isn't associated
with anything.

I'm not handy with xmodmap, so could you briefly explain how
to map key numbers to characters?
The key is number 94.
 
Old 09-20-2007, 12:48 PM   #9
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,644

Rep: Reputation: 145Reputation: 145
You can view what your current keyboard mapping is with "xmodmap -pke" (call xmodmap to see the available options).

For example with my German keyboard layout the line about key number 94 reads:
Code:
keycode  94 = less greater bar brokenbar bar brokenbar
This line does not change if I change to "se" keyboard layout. To change it using the xmodmap file edit the file ".Xmodmap" (with dot in the beginning and capital X) in your home directory or create a new one. Create a line with the above line "keycode 94 = ...". Then restart your X server.

Oh, this works only if you don't use graphical login manager. In this case you need to create the file ".xprofile" instead if I remember right.

Last edited by titopoquito; 09-20-2007 at 12:51 PM. Reason: added info for graphical login
 
Old 09-20-2007, 12:56 PM   #10
ixhabbaba
Member
 
Registered: Sep 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Thank you! Now < and > work fine. The only thing
that's missing now is the pipe character, which should
appear by pressing alt....
Still, progress!

Do I need to change anything else in the .xmodmap for the pipe
bar to work?

Last edited by ixhabbaba; 09-20-2007 at 01:38 PM.
 
Old 09-20-2007, 02:21 PM   #11
otoomet
Member
 
Registered: Oct 2004
Location: Tartu, Århus,Nürnberg, Europe
Distribution: Debian, Ubuntu, Puppy
Posts: 619

Rep: Reputation: 45
Probably yes... I could not manage just to remap <>| key, I had to remap everything because otherwise altgr was not recognized as a modifier. It should be possible, but this solution worked for me. There are two problems though: you lose the switching of virtual consoles with crtl-alt-f1..12 (should be possible to make it working), and you loose the xmodmap settings if you change the layout with setxkbmap (you have to run xmodmap again thereafter).

Try to get the current mappings of your keys with xmodmap, save these to a file, and modify the relevant keys.

Best,
Ott

Code:
! Almost correct version of xmodmap.ee
! generated from xmodmap.fi 1999-09-28 00:05 CET
!
! Estonian uses iso-8859-15, so I changed some keysyms to iso8859-15 ones
!	Pablo Saratxaga (pablo@mandrakesoft.com)
!
clear Mod1
clear Mod2
keycode   9 = Escape Escape
keycode  10 = 1 exclam
keycode  11 = 2 quotedbl at
keycode  12 = 3 numbersign sterling
keycode  13 = 4 dollar dollar
keycode  14 = 5 percent
keycode  15 = 6 ampersand
keycode  16 = 7 slash braceleft
keycode  17 = 8 parenleft bracketleft
keycode  18 = 9 parenright bracketright
keycode  19 = 0 equal braceright
keycode  20 = plus question backslash
keycode  21 = dead_acute dead_grave
keycode  22 = BackSpace Delete
keycode  23 = Tab Tab
keycode  24 = q
keycode  25 = w
keycode  26 = e E EuroSign
keycode  27 = r
keycode  28 = t
keycode  29 = y
keycode  30 = u
keycode  31 = i
keycode  32 = o
keycode  33 = p
keycode  34 = udiaeresis Udiaeresis
keycode  35 = otilde Otilde section
keycode  36 = Return
keycode  37 = Control_L
keycode  38 = a
keycode  39 = s S scaron Scaron
keycode  40 = d
keycode  41 = f
keycode  42 = g
keycode  43 = h
keycode  44 = j
keycode  45 = k
keycode  46 = l
keycode  47 = odiaeresis Odiaeresis
keycode  48 = adiaeresis Adiaeresis asciicircum
keycode  49 = asciicircum asciitilde
keycode  50 = Shift_L
keycode  51 = apostrophe asterisk oe
keycode  52 = z Z zcaron Zcaron
keycode  53 = x
keycode  54 = c
keycode  55 = v
keycode  56 = b
keycode  57 = n
keycode  58 = m
keycode  59 = comma semicolon
keycode  60 = period colon Multi_key
keycode  61 = minus underscore
keycode  62 = Shift_R
keycode  63 = KP_Multiply
keycode  64 = Alt_L Meta_L
keycode  65 = space space
keycode  66 = Caps_Lock
keycode  67 = F1 F11
keycode  68 = F2 F12
keycode  69 = F3 F13
keycode  70 = F4 F14
keycode  71 = F5 F15
keycode  72 = F6 F16
keycode  73 = F7 F17
keycode  74 = F8 F18
keycode  75 = F9 F19
keycode  76 = F10 F20
keycode  77 = Num_Lock
keycode  78 = Scroll_Lock
keycode  79 = KP_7
keycode  80 = KP_8
keycode  81 = KP_9
keycode  82 = KP_Subtract
keycode  83 = KP_4
keycode  84 = KP_5
keycode  85 = KP_6
keycode  86 = KP_Add
keycode  87 = KP_1
keycode  88 = KP_2
keycode  89 = KP_3
keycode  90 = KP_0
keycode  91 = KP_Decimal
keycode  94 = less greater bar
keycode  95 = F11 F11
keycode  96 = F12 F12
keycode 108 = KP_Enter
keycode 109 = Control_R
keycode 112 = KP_Divide
keycode 113 = Mode_switch
keycode 114 = Break
keycode 110 = Find
keycode  98 = Up
keycode  99 = Prior
keycode 100 = Left
keycode 102 = Right
keycode 115 = less greater bar
keycode 104 = Down
keycode 105 = Next
keycode 106 = Insert
! right windows-logo key
! in "windows" keyboards the postion of the key is annoying, is where AltGr
! usually resides, so go definie it as AltGr
keycode 116 = Mode_switch
! right windows-menu key
keycode 117 = Multi_key
!
add Mod1 = Alt_L
add Mod2 = Mode_switch
 
Old 09-21-2007, 12:42 PM   #12
ixhabbaba
Member
 
Registered: Sep 2007
Posts: 35

Original Poster
Rep: Reputation: 15
Yay! Everything works now!
Aitäh!
 
  


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
Keymap problem ixhabbaba Linux - Software 1 09-16-2007 12:00 PM
slackware 10.2 keymap problem sw0ks Linux - Laptop and Netbook 2 10-15-2005 01:45 PM
Solaris 10 UK Keymap problem Zoaky Solaris / OpenSolaris 3 07-23-2005 04:58 PM
VNC keymap problem make Linux - Software 6 07-14-2004 09:49 PM
keymap problem freelinuxcpp Linux - Software 0 12-01-2003 04:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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