User Feedback :: non-us keyboard fix in .xinitrc doesn't work



Using DSL 2.4, frugal install to HD, I noticed that there's a fix in /home/dsl/.xinitrc for the non-us keyboard problem with not being able to reach e.g. @ (alt-gr 2 on my Swedish keyboard)

Code Sample
# For non-US Keyboards
if [ ${KEYTABLE:0:2} != "us" ]; then
 xmodmap -e "clear Mod4" -e "add Mod5 = Mode_switch" &
fi

On my system this doesn't work, though. After experimenting, I found that the line
Code Sample
 xmodmap -e "clear Mod4" -e "add Mod5 = Mode_switch" &

is OK, it works by itself.

So I commented out the if and fi lines:
Code Sample
# For non-US Keyboards
#if [ ${KEYTABLE:0:2} != "us" ]; then
 xmodmap -e "clear Mod4" -e "add Mod5 = Mode_switch" &
#fi

and everything works OK here! :D

The error must be in the
Code Sample
if [ ${KEYTABLE:0:2} != "us" ]; then

I couldn't say what that would be, though, or if it's the same on other systems...
???

OK, I'll comment this myself...

The output for:

Code Sample
getknoppixparam.lua KEYTABLE


is actually "us", although I have specified at bootup a non-us keyboard (Swedish)! And the Swedish keyboard works very good, with all the åäö and @£${[]}\| in their correct places. So what's wrong?

Actually I notice just now that the Spanish letter ñ, that is n with a ~ on top, comes out as ~n. (I had to get the correct letter with copy and paste). That's normally a two-key combination, alt-gr ~ followed by n. Oh no, all accents are the same, ´o instead of ó etc......

Oh well... :O

How and where may I ask are you specifying your Swedish keyboard? At boot time with boot code? Using the keyboard GUI? Using the command prompt using loadkeys? Or maybe in /opt/bootlocal.sh?
It's a frugal install (DSL 2.4) to HD using LILO. The installation script asked me what keyboard I wanted so I answered "se".

During startup I see these lines (among many others...) pass by:
Quote
INIT: Entering runlevel: 5
Restoring backup files from /mnt/hda3/ Done.
Loading usr/share/keymaps/i386/qwerty/se-latin1.kmap.gz
su(pam_unix)[811] ... etc.

Here's my /cdrom/boot/lilo.conf file:
Code Sample
lba32          #enable large disk support
timeout=30     #wait 3 seconds before auto-booting
vga=normal
boot=/dev/hda   #put boot loader in MBR of target disk
root=/dev/hda1 #set root to be partition of target disk
image=/boot/linux24
label=DSL
initrd=/boot/minirt24.gz
read-only
APPEND="ramdisk_size=100000 init=/etc/init lang=us apm=power-off hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi nomce nodma quiet frugal BOOT_IMAGE=/KNOPPIX/KNOPPIX restore=hda3 home=hda3 opt=hda3 host=tor noscsi lang=se  mydsl=hda3"

and here's /opt/bootlocal.sh:
Code Sample
#!/bin/bash
# put other system startup command here
loadkeys se-latin1
/usr/sbin/lpd

I see there is a "lang=us" early in the APPEND line and a "lang=se" near the end. (Also a lot of unnecessary "hda=scsi"  etc. although I specified "noscsi" during installation.)

I don't specify anything else neither before nor after booting up.

Actually I chose LILO because it was easy to do these "restore=hda3 home=hda3 opt=hda3 host=tor noscsi lang=se  mydsl=hda3" easily during installation, which the grub script doesn't provide. (Edit: removed irrelevant and stupid part....) :D

Thanks for a great distro!
:laugh:

Oh, but please note that the "alt-gr" problem (for reaching characters @£${[]}\|) only applies to Firefox. In e.g. Ted, they can be typed normally.

The other problem with the accents seems to be more general (´o instead of ó etc.), that is, the problem appears in all applications and with or without the xmodmap fix.

Just to clarify, hopefully... :p

Next Page...
original here.