[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Lower-case parens
- To: address@hidden
- Subject: Re: Lower-case parens
- From: address@hidden
- Date: Fri, 14 Dec 2001 09:44:20 -0400
- Cc: address@hidden
- In-reply-to: <20011210205110.18468.qmail@web9502.mail.yahoo.com> (message fromChandrashekhar Shetty on Mon, 10 Dec 2001 12:51:10 -0800 (PST))
- References: <20011210205110.18468.qmail@web9502.mail.yahoo.com>
- Reply-to: address@hidden
- Sender: address@hidden
Can you please post the non-x-windows keymap file
also?
Chandra-
No trouble. Here you go. Feed the first five lines of
! Swap () and []
keycode 0x12 = 9 bracketleft
keycode 0x13 = 0 bracketright
keycode 0x22 = parenleft braceleft
keycode 0x23 = parenright braceright
! Make the caps-lock key be a control key.
clear Lock
keycode 0x42 = Control_L
add Control = Control_L Control_R
! Alt_R is meta.
add Mod1 = Alt_R
! Swap escape and ~/`
!keycode 0x09 = grave asciitilde
!keycode 0x31 = Escape asciitilde
to xmodmap, and you'll swap [] & () on a PC keyboard. I put the stuff above
in a file .xmodmap.i686, which I load from inside my .xinitrc file as
follows:
;;; Shorthand
(define $ getenv)
(define ^ string-append)
;;; Hack the keyboard
(cond ((let ((a ($ "ARCH"))) ;; Look for a file named .xmodmap.<arch>
(and a (let ((f (^ ".dots/xmodmap." a)))
(and (file-readable? f) f))))
=> (lambda (keyhax) (run (xmodmap ,keyhax))))
;; Look for a simple .xmodmap file
((file-readable? ".dots/xmodmap")
(run (xmodmap .dots/xmodmap))))
Translated for sh, that's
# Hack the keyboard
# Look for a file named .xmodmap.<arch>
if [ -r ".dots/xmodmap.$ARCH" ]; then
xmodmap ".dots/xmodmap.$ARCH"
# Look for a simple .xmodmap file
elif [ -r .dots/xmodmap ]; then
xmodmap .dots/xmodmap
fi
This all assumes you defined an environment variable $ARCH to be a string
like "i686" or "sun4" when you logged in. If $ARCH isn't defined, you
just load a plain old ".xmodmap" file.
-Olin