How to get "Command key" key code for Mac USB keyboard

How to get "Command key" key code for Mac USB keyboard

Post by Henry S. Greensi » Sun, 05 May 2002 11:31:49



I have been using a Macintosh USB keyboard with my
Linux RH 7/1 system since the keyboard has a nice
touch. I would like to use xmodmap to remap the left
control key to the left command/apple key (to use my
thumb rather than pinky for control). Can someone tell
me how to figure out the key code of the command/apple
key?

    Thanks,

    Henry

 
 
 

How to get "Command key" key code for Mac USB keyboard

Post by Dances With Crow » Sun, 05 May 2002 12:25:58


On 03 May 2002 22:31:49 -0400, Henry S. Greenside staggered into the
Black Sun and said:

Quote:> I have been using a Macintosh USB keyboard with my Linux RH 7/1 system
> since the keyboard has a nice touch. I would like to use xmodmap to
> remap the left control key to the left command/apple key (to use my
> thumb rather than pinky for control). Can someone tell me how to
> figure out the key code of the command/apple key?

The keys on those things are way too small, and give me something with
clicky-keys, preferably an IBM Indestructible that weighs 5 pounds... oh
well, YMMV.

In X, start an xterm/konsole/Eterm , and inside that terminal app,
execute "xev".  After the initialization messages scroll by, try
pressing a few keys.  You'll notice things like this appearing in the
xterm:

KeyPress event, serial 27, synthetic NO, window 0x3600001,
    root 0x37, subw 0x0, time 2575505226, (710,-367), root:(714,417),
    state 0x0, keycode 117 (keysym 0xff67, Menu), same_screen YES,
                       ^^^
    XLookupString gives 0 characters:  ""

Way too much information, but the "117" there is the keycode received.
This is from me pressing the Menu key on an MS Natural Pro.  I can
map this key to another keysym like so:

xmodmap -e 'keycode 117 = Control_L'

if I wanted my Menu key to act like the left Ctrl key in all X
applications.  Once you've found out the keycode, you can put that
xmodmap command line into ~/.Xmodmap , which will be sourced
automagically when X is started.

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /
http://www.brainbench.com     /  "He is a rhythmic movement of the
-----------------------------/    penguins, is Tux." --MegaHAL

 
 
 

How to get "Command key" key code for Mac USB keyboard

Post by Craig McCluske » Sat, 11 May 2002 09:30:58



> if I wanted my Menu key to act like the left Ctrl key in all X
> applications.  Once you've found out the keycode, you can put that
> xmodmap command line into ~/.Xmodmap , which will be sourced
> automagically when X is started.

Not in my experience. In RH7.2, I had to put it in /etc/rc.d/rc.local.

Craig

--

send mail to   mccluskey (at) mail (dot) utexas (dot) edu

 /"\                      
 \ /  ASCII RIBBON CAMPAIGN       "Friends don't send friends
  X   AGAINST HTML MAIL                   HTML email."
 / \  AND POSTINGS

 
 
 

How to get "Command key" key code for Mac USB keyboard

Post by Dances With Crow » Sat, 11 May 2002 09:50:42


On Thu, 09 May 2002 19:30:58 -0500, Craig McCluskey staggered into the
Black Sun and said:


>> if I wanted my Menu key to act like the left Ctrl key in all X
>> applications.  Once you've found out the keycode, you can put that
>> xmodmap command line into ~/.Xmodmap , which will be sourced
>> automagically when X is started.

> Not in my experience. In RH7.2, I had to put it in /etc/rc.d/rc.local.

The following lines are in /etc/X11/xinit/xinitrc in Redhat 7.1 :

usermodmap=$HOME/.Xmodmap
    if [ -f "$usermodmap" ]; then
        xmodmap "$usermodmap"
    fi

...so it *should* have worked.  SuSE does something very similar, in the
standard user's ~/.xinitrc , this line shows up:

    test -r $HOME/.Xmodmap      && xmodmap $HOME/.Xmodmap

Having xmodmap commands in /etc/init.d/boot.local is a bad idea, since
there's no guarantee that X will be running--what if you've booted to a
runlevel without X?  OTOH, the man page for xmodmap says that the place
to put the commands is ~/.xmodmaprc , and 2 large distros name that file
differently.

Standards.  Way too many of them to choose from.

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /
http://www.brainbench.com     /  "He is a rhythmic movement of the
-----------------------------/    penguins, is Tux." --MegaHAL

 
 
 

1. Enabling "windows key" on 104-key keyboard

I swear, I'm going insane. I want to enable the left and right windows
keys on my PC104 keyboard (Micron OEM from NMB Keyboards). I'm running
RH 5.0 on an i686. I've tried to manipulate the XF86Config file to no
avail. Something odd, however, is that the "menu key" does, in fact,
generate an event and ~g  is printed to the screen (even when the
keyboard is defined as pc101). How do I a) enable all 104 glorious keys
and b) test if they're enabled? Thanks!

--
"Love is like a baby. It needs care and protection. Oh, and it eats
salsa. Straight from the jar. Well, at least my baby does."

2. Enterprise Management Forum (Unicenter TNG, OpenView, Tivoli, Platinum)

3. Extend Keyboard keys: (sound up/down, the "Dell" button, "Play"....)

4. about kgdb question!

5. Keyboard with Control key next to the "A" key?

6. No sound on 2.2.1 !?

7. RH9: "gpg --gen-key" fails to create keys

8. Telnet 3270 and HLLAPI

9. How to turn "Windows" key into "Alt"?

10. Incorrect key "translation" behavior for "xterm"

11. Swapping the function keys "Ctrl" and "Compose Character"

12. pb with "lower" and "greater" key

13. I can't get my "|" or "" keys to work!