Re: Typing an '@' symbol on an Apple keyboard

2007-05-17 Thread Florian Kulzer
[ You accidentally sent this message to me personally and to
  debian-powerpc-REQUEST. I put this back on debian-user since I don't
  follow the powerpc list (and the -request address is wrong for
  normal list mails anyway). ]

On Thu, May 17, 2007 at 09:43:31 +0200, Matthias Brennwald wrote:
 Florian Kulzer wrote:
 On Wed, May 16, 2007 at 14:48:53 +0200, Matthias Brennwald (bwm) wrote:
 Dear all

 thanks for your replies so far. It looks like I'll have (i) to look 
 harder to find the correct key combination or (ii) tweak the 
 configuration my keyboard setup. I prefer (ii) because I want to use the 
 keys on my keyboard in the way they are labelled (I'm really bad in 
 remembering what keystrokes I'll have to press if it's not obvious from 
 the labels on the keys).

[...]

 Thanks! In the meantime I realised that the alt key to the right of the 
 space bar is different from the alt key to the left (that's different from 
 my previous MacOS-X experience, where both keys behave the same). I can 
 type the '@' with right-alt-g, but not with left-alt-g.

 What's the reason for this difference? Does it make sense to make left-alt 
 behave the same as right-alt?

I would not make Alt (left) and AltGr (that is how the right one is
usually labeled on pc keyboards) the same since you will lose
functionality if you do that. Just to give one example: If I use the .
key with AltGr then I get ยท (a dot in the middle of the line). The
normal Alt, on the other hand, can give the key an additional function
(which depends on the application). In the bash shell Alt + . is a
convenient way to insert the last argument from the previous command at
the cursor position. This saves a lot of typing and I would certainly
not want to miss it.

A lot of other X features also depend on a normal Alt, e.g. CTRL + ALT
+ Fn to switch to a tty, CTRL + ALT + BACKSPACE to kill the X server,
etc. To make sure that you are not missing anything I would rather
swap the two keys than make both act as AltGr.

   If not, (how) can I switch their behaviour, 
 i.e. exchange left-alt with right-alt? (I am used to using left-alt, and 
 since I'm switching a lot between Debian and MacOS I'd like to keep things 
 as similar as possible).

 For a start, I need to see the output of:
 xmodmap -pk | grep '(g)\|ISO_Level3_Shift'

 xmodmap -pk | grep '(g)\|ISO_Level3_Shift'
  42 0x0067 (g)  0x0047 (G)  0x0040 (at)  0x002c (comma)  0x0040 
 (at)  0x002c (comma)
  ^^^  
^^^
All is well: the macintosh keyboard definition already has the (at)
key symbol at the correct places. (Otherwise we would have put it
there.)

 113 0xfe03 (ISO_Level3_Shift)
 124 0xfe03 (ISO_Level3_Shift)

[...]

I can show you how to swap the functions of the two Alt keys. Let me
first clarify a few terms: Every key has a fixed keycode which does not
change. Xkb assigns one or more symbols (keysyms) to each key(code).
The keysyms determine what is sent to the active X application when a
given key is pressed (and released, but that is a minor detail). The
above output of xmodmap tells you that the key with code 42 will produce
symbol g when pressed alone, symbol G when pressed with SHIFT, and,
among other things, @ if pressed with the ISO_Level3_Shift modifier
(which is usually AltGr). You can run xev and press a few keys to see
how this works in practice. In fact, your first step is to find out the
keycodes for Alt and AltGr with xev. On my keyboard Alt has keycode 64
and AltGr has 113. Make sure to also check out the difference between
pressing Alt(left) + g and Alt(right) + g.

As you probably already guessed, the command to view and change keysyms
is xmodmap. So, let's have a look at the keysyms of Alt and AltGr:

$ xmodmap -pke | egrep 'keycode +(64|113)'
keycode  64 = Alt_L Meta_L
keycode 113 = ISO_Level3_Shift

(You can have a look at the entire keymap with xmodmap -pke | less.)

The output of xmodmap -pke has the right format to be fed back to
xmodmap in order to change keysyms. In principle you only have to
exchange 64 and 113 in the two commands above and you will swap the
two Alt keys (as far as any X application can tell). There is, however,
a small complication: Xkb has an additional keymap for all the modifier
keys, which you can display with xmodmap -pm:

$ xmodmap -pm
xmodmap:  up to 3 keys per modifier, (keycodes in parentheses):

shift   Shift_L (0x32),  Shift_R (0x3e)
lockCaps_Lock (0x42)
control Control_L (0x25),  Control_R (0x6d)
mod1Alt_L (0x40),  Alt_L (0x7d),  Meta_L (0x9c)
mod2Num_Lock (0x4d)
mod3
mod4Super_L (0x7f),  Hyper_L (0x80)
mod5Mode_switch (0x5d),  ISO_Level3_Shift (0x71),  ISO_Level3_Shift 
(0x7c)

This modifier map contains both keysyms and keycodes, and therefore
things will go wrong if you change keysyms of modifier keys on the
normal keymap without updating the modifier 

Re: Typing an '@' symbol on an Apple keyboard

2007-05-17 Thread Matthias Brennwald

Subject:
Re: Typing an '@' symbol on an Apple keyboard
From:
Florian Kulzer [EMAIL PROTECTED]
Date:
Thu, 17 May 2007 21:49:26 +0200
To:
debian-user debian-user@lists.debian.org

To:
debian-user debian-user@lists.debian.org


...


remove mod1 = Alt_L Meta_L
remove mod5 = ISO_Level3_Shift
keycode 113 = Alt_L Meta_L
keycode  64 = ISO_Level3_Shift
add mod1 = Alt_L Meta_L
add mod5 = ISO_Level3_Shift

You can put these six line into a plain text file (adapting 64 and
113 if necessary) and then run

xmodmap name-of-the-file-with-the-commands

to swap Alt and AltGr. This means that you have to use CTRL + ALT(right)
for all the special functions, and ALT(left) + g should give you @.

Depending on how you start X it might be enough to put the six commands
into a file called .Xmodmap in your home directory to have them
executed automatically at every start of X. If that does not work then
you have to find an autostart folder of your desktop environment and
put the xmodmap ~/.Xmodmap command in a script there.


Thanks, this does exactly what I wanted!

Matthias


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread Greg Folkert
On Wed, 2007-05-16 at 08:45 +0200, Matthias Brennwald (bwm) wrote:
 Dear all
 
 I'm a complete newbie, and I'm not sure which mailing list is the best 
 to post my question (I posted this to debian-user and debian-powerpc).
 
 I successfully installed Debian 4.0 / Etch on my Apple PowerBook G4. I 
 managed to setup my (external/USB) Apple keyboard with a Swiss-German 
 keymap. However, I could not figure out how to produce an '@' symbol... 
 in Mac OS X I press 'Option-g' to type an '@', but that does not work in 
 Linux / Debian. Any hints?

Umm, did you try the obvious one?

SHIFT-2 (the 2 above the qwerty keys)?
-- 
greg, [EMAIL PROTECTED]
PGP key: 1024D/B524687C  2003-08-05
Fingerprint: E1D3 E3D7 5850 957E FED0  2B3A ED66 6971 B524 687C
Alternate Fingerprint: 09F9 1102 9D74  E35B D841 56C5 6356 88C0



signature.asc
Description: This is a digitally signed message part


Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread Matthias Brennwald (bwm)



Greg Folkert wrote:

On Wed, 2007-05-16 at 08:45 +0200, Matthias Brennwald (bwm) wrote:

Dear all

I'm a complete newbie, and I'm not sure which mailing list is the best 
to post my question (I posted this to debian-user and debian-powerpc).


I successfully installed Debian 4.0 / Etch on my Apple PowerBook G4. I 
managed to setup my (external/USB) Apple keyboard with a Swiss-German 
keymap. However, I could not figure out how to produce an '@' symbol... 
in Mac OS X I press 'Option-g' to type an '@', but that does not work in 
Linux / Debian. Any hints?


Umm, did you try the obvious one?

SHIFT-2 (the 2 above the qwerty keys)?


Yes, I did. On the Apple keyboard, Shift-2 is mapped to something else 
than '@' (propably '', but I am not sure because at the moment I'm in 
my office in front of a PC, while the Mac rests at home). Shift-2 
therefore does not give an '@', but rather the symbol that is written on 
the Apple keyboard. I also tried Option-2 and other 'number keys' with 
the Option modifier etc., but that did not work, too (this either 
produce no symbol at all or something else than an '@').


Matthias

--
Matthias Brennwald
Nagra
Hardstrasse 73
CH-5430 Wettingen
+41 56 437 13 32


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread Joe Hart
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthias Brennwald (bwm) wrote:
 
 
 Greg Folkert wrote:
 On Wed, 2007-05-16 at 08:45 +0200, Matthias Brennwald (bwm) wrote:
 Dear all

 I'm a complete newbie, and I'm not sure which mailing list is the
 best to post my question (I posted this to debian-user and
 debian-powerpc).

 I successfully installed Debian 4.0 / Etch on my Apple PowerBook G4.
 I managed to setup my (external/USB) Apple keyboard with a
 Swiss-German keymap. However, I could not figure out how to produce
 an '@' symbol... in Mac OS X I press 'Option-g' to type an '@', but
 that does not work in Linux / Debian. Any hints?

 Umm, did you try the obvious one?

 SHIFT-2 (the 2 above the qwerty keys)?
 
 Yes, I did. On the Apple keyboard, Shift-2 is mapped to something else
 than '@' (propably '', but I am not sure because at the moment I'm in
 my office in front of a PC, while the Mac rests at home). Shift-2
 therefore does not give an '@', but rather the symbol that is written on
 the Apple keyboard. I also tried Option-2 and other 'number keys' with
 the Option modifier etc., but that did not work, too (this either
 produce no symbol at all or something else than an '@').
 
 Matthias
 

Wow, I remember that from the old Atari 400 and 800.  They had the quote
key above the 2 as well.  I would suggest checking your keymapping, and
make sure you've got the right keyboard selected.

Joe
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGSr3siXBCVWpc5J4RAoJCAJ9BDQqDy9YoYdR5z6VGVnucGA9k9wCfTG44
2lBdjy0KG0WNqN7KFYRYvt4=
=oK3R
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread Mike McCarty

Joe Hart wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthias Brennwald (bwm) wrote:



Greg Folkert wrote:


On Wed, 2007-05-16 at 08:45 +0200, Matthias Brennwald (bwm) wrote:


Dear all

I'm a complete newbie, and I'm not sure which mailing list is the
best to post my question (I posted this to debian-user and
debian-powerpc).

I successfully installed Debian 4.0 / Etch on my Apple PowerBook G4.
I managed to setup my (external/USB) Apple keyboard with a
Swiss-German keymap. However, I could not figure out how to produce
an '@' symbol... in Mac OS X I press 'Option-g' to type an '@', but
that does not work in Linux / Debian. Any hints?


Umm, did you try the obvious one?

SHIFT-2 (the 2 above the qwerty keys)?


Yes, I did. On the Apple keyboard, Shift-2 is mapped to something else
than '@' (propably '', but I am not sure because at the moment I'm in


That sounds like a minimum keyboard, IOW, one which uses the shift
key just to set/clear bits in the ASCII code. Old ADM terminals were
like that. The ADM-1 was, anyway. I don't recall the key now. But
from looking at the ASCII chart, I suggest you try SHIFT-`
(that's SHIFT-GRAVE_ACCENT, which may be below the tilde (~) on
your keyboard). On such keyboards, SHIFT just clears bit 0x20.

Mike
--
p=p=%c%s%c;main(){printf(p,34,p,34);};main(){printf(p,34,p,34);}
Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread Matthias Brennwald (bwm)

Dear all

thanks for your replies so far. It looks like I'll have (i) to look 
harder to find the correct key combination or (ii) tweak the 
configuration my keyboard setup. I prefer (ii) because I want to use the 
keys on my keyboard in the way they are labelled (I'm really bad in 
remembering what keystrokes I'll have to press if it's not obvious from 
the labels on the keys).
So far I've seen hints to make X11 use the keymaps from a given file. 
However, with the keymap setting that comes cloesest to my keyboard, the 
'@' (which is located on the 'G' key of my keyboard) is not functional. 
Therefore: is it possible to explicitly tell X11 how to handle the 
behaviour of a given keystroke that is not otherwise handled by the 
'normal' keymap settings? If so, I'd like to make 'Alt-g' to produce an 
'@' (that's the way it's normally done on my keyboard).


Cheers,
Matthias

--
Matthias Brennwald
Nagra
Hardstrasse 73
CH-5430 Wettingen
+41 56 437 13 32


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]




Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread Joe Hart
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mike McCarty wrote:

 Matthias Brennwald (bwm) wrote:


 Greg Folkert wrote:

 On Wed, 2007-05-16 at 08:45 +0200, Matthias Brennwald (bwm) wrote:

 Dear all

 I'm a complete newbie, and I'm not sure which mailing list is the
 best to post my question (I posted this to debian-user and
 debian-powerpc).

 I successfully installed Debian 4.0 / Etch on my Apple PowerBook G4.
 I managed to setup my (external/USB) Apple keyboard with a
 Swiss-German keymap. However, I could not figure out how to produce
 an '@' symbol... in Mac OS X I press 'Option-g' to type an '@', but
 that does not work in Linux / Debian. Any hints?

 Umm, did you try the obvious one?

 SHIFT-2 (the 2 above the qwerty keys)?

 Yes, I did. On the Apple keyboard, Shift-2 is mapped to something else
 than '@' (propably '', but I am not sure because at the moment I'm in
 
 That sounds like a minimum keyboard, IOW, one which uses the shift
 key just to set/clear bits in the ASCII code. Old ADM terminals were
 like that. The ADM-1 was, anyway. I don't recall the key now. But
 from looking at the ASCII chart, I suggest you try SHIFT-`
 (that's SHIFT-GRAVE_ACCENT, which may be below the tilde (~) on
 your keyboard). On such keyboards, SHIFT just clears bit 0x20.
 
 Mike

Mike, two comments:  1) You don't need to CC: me, I read the list.
2) I did not write any of the above text.  You snipped everything I
wrote without marking it being snipped, but still show my name.

As for the issue at hand, it seems like a simple reassignment of the
keyboard definitions would solve the problem.

If Matthias is only interested in fixing the settings in X, then
dpkg-reconfigure xorg-xserver will walk him through the settings for X,
including the keyboard setup.

Joe
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGSxAqiXBCVWpc5J4RAryYAJ91IChaQ14+ihX6+kWK+zB51eyKXwCghZkv
YYA2sDTolfV/HI88yU+ZoQE=
=ENVV
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread Florian Kulzer
On Wed, May 16, 2007 at 14:48:53 +0200, Matthias Brennwald (bwm) wrote:
 Dear all

 thanks for your replies so far. It looks like I'll have (i) to look harder 
 to find the correct key combination or (ii) tweak the configuration my 
 keyboard setup. I prefer (ii) because I want to use the keys on my keyboard 
 in the way they are labelled (I'm really bad in remembering what keystrokes 
 I'll have to press if it's not obvious from the labels on the keys).
 So far I've seen hints to make X11 use the keymaps from a given file. 
 However, with the keymap setting that comes cloesest to my keyboard, the 
 '@' (which is located on the 'G' key of my keyboard) is not functional. 
 Therefore: is it possible to explicitly tell X11 how to handle the 
 behaviour of a given keystroke that is not otherwise handled by the 
 'normal' keymap settings? If so, I'd like to make 'Alt-g' to produce an '@' 
 (that's the way it's normally done on my keyboard).

I might be able to tell you how to set this up using xmodmap, but this
depends on how similar your Apple keyboard is to the pc105 ones that I
know. For a start, I need to see the output of:

xmodmap -pk | grep '(g)\|ISO_Level3_Shift'

It can also not hurt if you post the keyboard part of your xorg.conf.
You can run

awk '/Section InputDevice/,/EndSection/' /etc/X11/xorg.conf

to display all sections related to input devices.

-- 
Regards,| http://users.icfo.es/Florian.Kulzer
  Florian   |


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread s. keeling
Florian Kulzer [EMAIL PROTECTED]:
  On Wed, May 16, 2007 at 14:48:53 +0200, Matthias Brennwald (bwm) wrote:
 
  thanks for your replies so far. It looks like I'll have (i) to look harder 
  to find the correct key combination or (ii) tweak the configuration my 
  keyboard setup. I prefer (ii) because I want to use the keys on my keyboard 
  in the way they are labelled (I'm really bad in remembering what keystrokes 
  I'll have to press if it's not obvious from the labels on the keys).
 
  I might be able to tell you how to set this up using xmodmap, but this
  depends on how similar your Apple keyboard is to the pc105 ones that I
  know. For a start, I need to see the output of:
 
  xmodmap -pk | grep '(g)\|ISO_Level3_Shift'
 
  It can also not hurt if you post the keyboard part of your xorg.conf.
  You can run
 
  awk '/Section InputDevice/,/EndSection/' /etc/X11/xorg.conf

Damn, I love this mailing list.  Some of you people are like gods to
me.  The best I was able to come up with on this was wrong keyboard
definition and maybe play with xev to see what it says the key's
doing.

Some of you must spend your entire day reading man pages.  :-0

Woof.  Way cool, Florian.


-- 
Any technology distinguishable from magic is insufficiently advanced.
(*)http://www.spots.ab.ca/~keeling  Linux Counter #80292
- -http://www.faqs.org/rfcs/rfc1855.htmlPlease, don't Cc: me.
   Spammers! http://www.spots.ab.ca/~keeling/emails.html


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: Typing an '@' symbol on an Apple keyboard

2007-05-16 Thread Greg Folkert
On Thu, 2007-05-17 at 03:28 +, s. keeling wrote:
 Florian Kulzer [EMAIL PROTECTED]:
   I might be able to tell you how to set this up using xmodmap, but this
   depends on how similar your Apple keyboard is to the pc105 ones that I
   know. For a start, I need to see the output of:
  
   xmodmap -pk | grep '(g)\|ISO_Level3_Shift'
  
   It can also not hurt if you post the keyboard part of your xorg.conf.
   You can run
  
   awk '/Section InputDevice/,/EndSection/' /etc/X11/xorg.conf
 
 Damn, I love this mailing list.  Some of you people are like gods to
 me.  The best I was able to come up with on this was wrong keyboard
 definition and maybe play with xev to see what it says the key's
 doing.
 
 Some of you must spend your entire day reading man pages.  :-0
 
 Woof.  Way cool, Florian.

What it actually comes from is HOURS and HOURS and HOURS of trying to
fix things. Learning what to do and what to REALLY stay away from.
Learning what give you what you want in the fewest keystrokes or the
least work to wrap you mind around something.

awk... if you use *NIX: sed, grep, awk are your three bestestest
friends.

Just to give you an idea of what I mean, I was able to fix an entire set
of 3M+ records in a system by:

  * Dumping the data into a dumpfile
  * Use grep to locate the bad data and look at it.
  * use sed to change all the data needing to be changed, in one
pass.
  * use awk to display it properly to make sure nothing went wrong
  * write it to another file
  * rename the old table
  * create a new table (with indexes, etc)
  * verify the data through programmers reports
  * Drop the old table

All in less time than it would have taken to let the system fix it. As
the relational stuff would have killed performance in any case.

the 3M+ records were actually corrected in under 3 minutes on an old
1GHz Linux machine with lotsa memory. The 4 CPU server would have been
pegged for hours. We tried to correct the data on the QA system, which
is a complete mirror of the production machine.

Can we say ouch?
-- 
greg, [EMAIL PROTECTED]
PGP key: 1024D/B524687C  2003-08-05
Fingerprint: E1D3 E3D7 5850 957E FED0  2B3A ED66 6971 B524 687C
Alternate Fingerprint: 09F9 1102 9D74  E35B D841 56C5 6356 88C0



signature.asc
Description: This is a digitally signed message part