How to get the @ key to work on a laptop keyboard?

Booting, installing, newbie
Post Reply
Message
Author
trampintransit2
Posts: 24
Joined: Tue 02 Jun 2009, 12:56
Location: Scottish Borders

How to get the @ key to work on a laptop keyboard?

#1 Post by trampintransit2 »

Having installed puppy on an old laptop, no matter what keyboard i select in the setup menu, i cant get one of the keys to work (the @ key, as in an email address.) Can I access it via a character set elsewhere, or interrogate the keyboard in any way? I really don'I' think its the hardware, im sure the key worked when I had XP installed.
jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#2 Post by jafadmin »

Well it's for sure either a hardware or OS problem.

Maybe if we knew what kind of hardware you have and which OS you have we could help :?
User avatar
irishrm
Posts: 271
Joined: Sat 14 Mar 2009, 14:09

@

#3 Post by irishrm »

The @ key can be found by pressing shift+2 Irishrm
davesurrey
Posts: 1198
Joined: Tue 05 Aug 2008, 18:12
Location: UK

#4 Post by davesurrey »

irishrm wrote
The @ key can be found by pressing shift+2 Irishrm
Yes if you have a US keyboard layout but not for all layouts. eg in the UK-GB keyboard pressing shift+2 gives the " symbol.

However I don't think he was interested in where it was physically but rather that it didn't work and he wanted an alternative way to enter the symbol.

Like in Windows it's alt+64 (using the numbers keypad to type 64).

Good question. Does anyone else know if it can be done in Linux. Ascii is ascii after all and not OS dependent.

Thanks
Dave
User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#5 Post by Sit Heel Speak »

If changeing the keyboard country code in /etc/keymap to the correct one for this laptop does not fix it, then either the key has died or else the keyboard must be sending a very unusual code.

Good reference:
http://cweiske.de/howto/xmodmap/allinone.html

Open an rxvt window and issue

Code: Select all

xev
Then try the @. It should output, to the console, two KeyPress events (one for the Shift key and the second for the @ key proper) and two KeyRelease events. On my us keyboard the output looks like this:

Code: Select all

KeyPress event, serial 30, synthetic NO, window 0x1a00001,
    root 0x63, subw 0x0, time 4257407994, (451,402), root:(583,560),
    state 0x0, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

KeyPress event, serial 30, synthetic NO, window 0x1a00001,
    root 0x63, subw 0x0, time 4257409884, (451,402), root:(583,560),
    state 0x1, keycode 11 (keysym 0x40, at), same_screen YES,
    XLookupString gives 1 bytes: (40) "@"
    XmbLookupString gives 1 bytes: (40) "@"
    XFilterEvent returns: False

KeyRelease event, serial 30, synthetic NO, window 0x1a00001,
    root 0x63, subw 0x0, time 4257410007, (451,402), root:(583,560),
    state 0x1, keycode 11 (keysym 0x40, at), same_screen YES,
    XLookupString gives 1 bytes: (40) "@"
    XFilterEvent returns: False

KeyRelease event, serial 30, synthetic NO, window 0x1a00001,
    root 0x63, subw 0x0, time 4257410134, (451,402), root:(583,560),
    state 0x1, keycode 50 (keysym 0xffe1, Shift_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False
Ctrl-C to get out of xev. Decimal 11 is the ascii keycode for @. You can see a complete list of the ascii keycodes understood by your keyboard driver within this X session, by issuing

Code: Select all

xmodmap -pke
The ascii keycodes can be remapped by creating a file ~/.Xmodmap (~ = /root in all Puppies except multiuser ones) and populating it as shown in the page linked above and briefly described below.

Some keys do not generate an ascii keycode, such as "wireless on/off" and "battery display on/off" special keys on laptops. For these, you must hit the key and then issue

Code: Select all

dmesg | tail
and thereby see what four-byte hexadecimal bios keycode was issued (well, at least, you can on mine, I have kernel loglevel set to 3--don't know if you can see it on Barry's kernels, which have kernel loglevel set to 7, or not). Then add, at the bottom of the user-specific init startup file /etc/rc.d/rc.local, a line such as

Code: Select all

setkeycodes e007 93
where e007 is the hexadecimal code shown by dmesg | tail and 93 is an unassigned ascii keycode as shown by xmodmap -pke. Then edit your ~/.Xmodmap to assign 93 to an unused keycode, the easy choice being an F-key higher than 12, say F13 (~./Xmodmap will contain the line:)

Code: Select all

keycode  93 = F13
. Finally, in the keybindings file of your window manager, associate F13 with the @ symbol. Identity and syntax of the keybindings file varies with the particular window manager, google and a little study are your friends here. Reboot, and all should be good.

HTH, SHS
Shep
Posts: 878
Joined: Sat 08 Nov 2008, 07:55
Location: Australia

Re: How to get the @ key to work on a laptop keyboard?

#6 Post by Shep »

trampintransit2 wrote:Having installed puppy on an old laptop, no matter what keyboard i select in the setup menu, i cant get one of the keys to work (the @ key, as in an email address.) Can I access it via a character set elsewhere, or interrogate the keyboard in any way? I really don'I' think its the hardware, im sure the key worked when I had XP installed.
First question: does every other punctuation symbol show up for
the expected keypress combo?
davesurrey
Posts: 1198
Joined: Tue 05 Aug 2008, 18:12
Location: UK

#7 Post by davesurrey »

SHS
Thank you for your very helpful and comprehensive reply.
I tried

Code: Select all

xev
in Puppy 214X and 431 and in both cases it reported keycode 48 for the @ symbol. Not 11 as in your case. I am using a UK (GB) keyboard so I hit the keys where @ is located on a US keyboard and it reported keycode 11. So keycodes seem to relate to where the keys are physically.
So when you say
Decimal 11 is the ascii keycode for @.
I guess you really mean
...for a US keyboard.
Also Ctlr+c didn't get me out of xev. I wonder what version of Puppy you are using?

I looked at xmodmap -pke but as the list is long I had to do

Code: Select all

xmodmap -pke | less
which gave me "at" at keycode 48. So far so good.

As all my keys are working just fine (it's trampintransit2 who has the problem) I didn't go any further as, although you have given an excellent description of what to do, it looked a bit of work.

I just was hoping there might be a simple app that would do this and allow, say, typing into it

Code: Select all

ctlr+64
as 64 is the decimal number for the @ character in the ascii character page, in a similar way, dare I say it, that Windows allows.

If you or anyone else knows of such an app I'd appreciate it.

Again thanks for this educational reply.
Appreciated
Dave
Oakems
Posts: 322
Joined: Sat 21 Mar 2009, 17:02

#8 Post by Oakems »

You can use the unicode for the @ sign, it is 0040, to enter it hold Ctrl+Shift and press u when you have a chance to write, you should then see an underlined u and it will allow to you type 0040, hit space and you're done. This is not an ideal solution, but it should work, and then you can always copy/paste it in the future.

Edit: If you are copying and pasting over more than one program, using a clipboard will make that really easy. I am not sure if all Puppy's have one? If not it shouldn't be hard to find a .pet in here somewhere.
User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#9 Post by Sit Heel Speak »

davesurrey wrote:Ctrl+c didn't get me out of xev. I wonder what version of Puppy you are using?
Not a standard one. It's a woof-based upup with full Gnome plus much more, the "rxvt" window is actually xterm. bash, readline, and so forth are all somewhat newer than "stock" Puppy's.

Glipper is one clipboard available for Puppy.
davesurrey
Posts: 1198
Joined: Tue 05 Aug 2008, 18:12
Location: UK

#10 Post by davesurrey »

Doing the Unicode way is exactly what I was looking for. Many thanks.
I guess when you say 40 is for @ it means it uses the ascii table code in hex form.
ie hex (40) = decimal (64)

It worked in leafpad, geany, abiword but not in Rxvt.
Thanks again
trampintransit2
Posts: 24
Joined: Tue 02 Jun 2009, 12:56
Location: Scottish Borders

#11 Post by trampintransit2 »

im using 4.3.1, if i open a console and enter xev i get -
command not found
DMcCunney
Posts: 889
Joined: Tue 03 Feb 2009, 00:45

#12 Post by DMcCunney »

trampintransit2 wrote:im using 4.3.1, if i open a console and enter xev i get -
command not found
It's /usr/X11R7/bin/xev in Puppy 4.31 here.

Check to see that /usr/X11R7/bin is in your $PATH.
______
Dennis
DMcCunney
Posts: 889
Joined: Tue 03 Feb 2009, 00:45

#13 Post by DMcCunney »

davesurrey wrote:[
I tried

Code: Select all

xev
in Puppy 214X and 431 and in both cases it reported keycode 48 for the @ symbol. Not 11 as in your case. I am using a UK (GB) keyboard so I hit the keys where @ is located on a US keyboard and it reported keycode 11. So keycodes seem to relate to where the keys are physically.
Correct.

When you press a key, they keyboard sends a scan code that equates to the position of the key on the keyboard. The OS maps that key position to whatever character is assigned to that key by the language and keyboard layout you use.
______
Dennis
User avatar
CatDude
Posts: 1563
Joined: Wed 03 Jan 2007, 17:49
Location: UK

#14 Post by CatDude »

Hi
DMcCunney wrote:
trampintransit2 wrote:im using 4.3.1, if i open a console and enter xev i get -
command not found
It's /usr/X11R7/bin/xev in Puppy 4.31 here.

Check to see that /usr/X11R7/bin is in your $PATH.
I seem to recall reading that xev was taken out of Puppy (i don't know when exactly), and i can't see it in a default 4.31

You can find it in various threads throughout the forum,
here is just two of them:

Bruce B Posted: Wed Oct 29, 2008 xev.zip
Pizzasgood Posted: Mon Jul 20, 2009 xev_standalone.pet

CatDude
.
Image
Post Reply