#!/bin/sh ### Remap to get proper Ctrl and Meta keys when using a PC keyboard ### on a Sun box thru an adaptor. xmodmap -e "keycode 26 = Meta_L" \ -e "keycode 20 = Meta_R" \ -e "keycode 83 = Control_L" \ -e "keycode 129 = Control_R" \ -e "clear Control" \ -e "clear Mod1" \ -e "clear Mod2" \ -e "clear Mod3" \ -e "add Control = Control_L Control_R" \ -e "add Mod1 = Meta_L Meta_R" \ -e "keycode 103 = Tab ISO_Left_Tab" \ -e "keycode 130 = semicolon colon" \ -e "keycode 93 = Next" \ -e "keycode 60 = Prior" # Strictly speaking, we don't need to reset the keysyms on the # keycodes (as is done in the first three expressions above). The # only thing that really matters is the modifier map. # Just for reference, here are the original keycodes we had to work # with, thanks to the `xev' program: ### This key is labeled Ctrl-L: # KeyPress event, serial 21, synthetic NO, window 0x1c00001, # root 0x25, subw 0x0, time 3988232684, (431,229), root:(409,358), # state 0x0, keycode 83 (keysym 0xffe3, Control_L), same_screen YES, # XLookupString gives 0 characters: "" # ### This key is labeled Alt-R: # KeyPress event, serial 21, synthetic NO, window 0x1c00001, # root 0x25, subw 0x0, time 3988234064, (431,229), root:(409,358), # state 0x0, keycode 26 (keysym 0xffe9, Alt_L), same_screen YES, # XLookupString gives 0 characters: "" # ### This key is labeled Alt-L: # KeyPress event, serial 21, synthetic NO, window 0x1c00001, # root 0x25, subw 0x0, time 3988236194, (431,229), root:(409,358), # state 0x0, keycode 20 (keysym 0xff7e, Mode_switch), same_screen YES, # XLookupString gives 0 characters: "" # ### This key is labeled Ctrl-R: # KeyPress event, serial 21, synthetic NO, window 0x1c00001, # root 0x25, subw 0x0, time 3988239514, (431,229), root:(409,358), # state 0x0, keycode 129 (keysym 0xffe8, Meta_R), same_screen YES, # XLookupString gives 0 characters: ""