How can I move keys around on a Sun keyboard, for example exchanging the Caps Lock and Control keys on a Type 5 keyboard?

	Caps Lock and Control keys on a Type 5 keyboard?

        It depends on which window system you're running, if any.

        If you're not using any window system, or you're using a window
        system such as SunView that uses the OS's keyboard event
        translation mechanism, you can dump the tables used by the OS's
        keyboard event translation mechanism with the "dumpkeys"
        command, and load changes to that table with the "loadkeys"
        command; see LOADKEYS(1).

        If you're using X11 - either in its MIT incarnation, or Sun's
        Open Windows incarnation - or some other window system that
        shuts off the OS's keyboard event translation mechanism, you
        need to use the window system's commands, if any, for that
        function.

        In X11, the command for that is "xmodmap"; its translation
        tables can be printed with "xmodmap -pk", and changes to that
        table can be loaded with "xmodmap" as well.

        NOTE: in the particular case of the Control and Caps Lock keys,
        while MIT X appears to handle interchanging those two keys
        correctly, so that the new Caps Lock key is a toggle and the new
        Control key is not, some versions of Open Windows do not - even
        though the keys have had their mappings exchanged, the window
        system server still thinks that the *old* Caps Lock key, which
        is now the Control key, should be a toggle, and that the *old*
        Control key, which is now the Caps Lock key, should not be a
        toggle.
	[Here is a work-around for this problem, provided by Mark Plotnick
	(mp@allegra.att.COM)]:
	Copy the appropriate keytable (e.g. /usr/openwin/etc/keytables/US4.kt)
	to $HOME/.keytable, and change the 2nd attribute character in a key's
	attributes field to N or P depending on whether the key should have 
	"pseudolock".
	$ diff /usr/openwin/etc/keytables/US4.kt /usr/gre/.keytable
	78,79c78,79
	< lock  119                     # CapsLock
	< control        76                     # Control
	---
	> lock   76                     # CapsLock
	> control       119                     # Control
	226c226
	< 76    NN      XK_Control_L
	---
	> 76    NP      XK_Caps_Lock
	278c278
	< 119   NP      XK_Caps_Lock
	---
	> 119   NN      XK_Control_L
 

Go to the index previous next